<template>
	<view class="container scl-result-page" :style="{
      'overflow':overHide?'hidden':'auto',
      'position':overHide?'fixed':'auto',
      'background-color':pageBgColor,
      paddingBottom: ((pageComp === 'fpacpt' || pageComp === 'animalforest' || pageComp === 'bestxg' || pageComp === 'queen'|| pageComp === 'mailun') && !posterResultIsComplete) ? '0' : '100rpx'
    }">
		<template v-if="isShowPage">
			<navigationBar emitBackEvent="true" @backEvent="backHandle" :show-back-home="!isShowMoreBtn"
				:my-property="navigationBarDataInfo"
				v-if="pageComp != 'dongwulianai' && pageComp !== 'fpacpt' && pageComp !== 'animalforest' && pageComp != 'bestxg'&& pageComp != 'mailun' && !showFullFloatImg" />
			<template v-else />

			<template v-if="nextId">
				<AddedServiceMbtiResultVue :nextId="nextId" :imgData="fanhuaData" :reportId="reportId"
					:reportInfo="detail" />
			</template>
			<template v-else-if="pageComp == 'normal'">
				<image :src="report_top_title" mode="" class="report-top-title"></image>
				<view class="rs-scl-title" :style="{backgroundImage:'url('+currentTitBg+')'}">
					<view class="rst-text">{{detail.sclName}}</view>
				</view>
				<view class="rs-time">报告生成时间{{detail.createDate}}</view>
				<view class="rs-content-box">
					<image :src="currentTitImg" mode="" class="rcb-title"></image>
					<view class="qiun-columns" v-if="isShowChart && showCanvas">
						<view v-if="scl3To1FristTit" class="scl-3-to-1-tit">{{scl3To1FristTit}}</view>
						<view class="qiun-charts">
							<canvas canvas-id="canvasPie" id="canvasPie" class="charts-pie"></canvas>
						</view>
					</view>


					<view class="muban" v-if="isScore ">
						<view class="muban1">
							您的得分：
							<text class="muban1-text muban1-text1">{{ score }}</text>
						</view>
					</view>
					<view class="title_box" v-if="setMap.length>0">
						<view class="title-item" v-for="(i, index) in renderResultData" :key="index">
							<image :src="i.resultPic" width="100%" mode="widthFix" crossorigin="*" v-if="i.isResultPic">
							</image>
							<view class="title-text-dmns"
								style="color: #32B16C;line-height: 50rpx;font-size: 36rpx;text-align: justify;">
								{{((i.resultTitle||i.dmnsName||''))}}
							</view>
							<view class="title-text-dmns" v-if="i.score&&i.interval"
								style="line-height: 50rpx;font-size: 36rpx;text-align: justify;">{{'我的得分'+ i.score }}
							</view>
							<view class="title-text-dmns" v-if="i.score&&i.interval"
								style="line-height: 50rpx;font-size: 36rpx;text-align: justify;">
								{{ '总分区间 1-'+(i.interval+1)}}
							</view>
							<view class="title-text2"
								v-if="i.resultDesc&&'<p><br></p>'!==i.resultDesc&&'<p><br></p><p><br></p>'!==i.resultDesc"
								v-html="i.resultDesc"
								style="line-height: 50rpx;font-size: 36rpx;text-align: justify;letter-spacing: 4rpx;word-break: break-all;white-space: pre-wrap;">
							</view>
							<template v-if="i.createCanvas && showCanvas">
								<view class="scl-3-to-1-tit mt-52" v-if="i.nextTit">
									{{i.nextTit}}
								</view>
								<canvas :canvas-id="'canvasPie'+i.index" :id="'canvasPie'+i.index"
									class="charts-pie"></canvas>
							</template>

						</view>
					</view>
				</view>
			</template>
			<template v-else-if="pageComp == 'pageA'">
				<CustomSclResultA :showCanvas="showCanvas" :pageData="pageDataA">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultA>
			</template>
			<template v-else-if="pageComp == 'pageSCL90'">
				<CustomSclResultB :showCanvas="showCanvas" :pageData="pageDataB" :isA="isA">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultB>
			</template>
			<template v-else-if="pageComp == 'pageMBTI'">
				<CustomSclResultMBTI :showCanvas="showCanvas" :pageData="pageDataMBTI">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultMBTI>
			</template>
			<template v-else-if="pageComp == 'pageCommon'">
				<CustomSclResultCommon :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultCommon>
			</template>
			<template v-else-if="pageComp == 'pagePPCS'">
				<CustomSclResultPPCS :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultPPCS>
			</template>
			<template v-else-if="pageComp === 'pageOLSON'">
				<CustomSclResultOLSON :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultOLSON>
			</template>
			<template v-else-if="pageComp === 'pageBD'">
				<CustomSclResultBD :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultBD>
			</template>
			<template v-else-if="pageComp === 'pageYLQYB'">
				<!-- 压力晴雨表 -->
				<CustomSclResultYLQYB :pageData="pageDataCommon" />
			</template>
			<template v-else-if="pageComp === 'pageOCEAN'">
				<CustomSclResultOCEAN :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResultOCEAN>
			</template>
			<template v-else-if="pageComp === 'pageCRYL'">
				<CustomSclResultCRYL :showCanvas="showCanvas" :pageData="pageDataCommon" />
			</template>
			<template v-else-if="pageComp === 'pageYY3TO1'">
				<CustomSclResult3TO1YY :showCanvas="showCanvas" :pageData="pageDataCommon">
					<template #special>
						<MailunEntry sourceType="18" isResAd v-if="isSclAllReport!='N'" />
					</template>
				</CustomSclResult3TO1YY>
			</template>
			<template v-else-if="pageComp === 'pageQX'">
				<CustomSclResultQX :showCanvas="showCanvas" :pageData="pageDataCommon" />
			</template>
			<template v-else-if="pageComp === 'dongwulianai'">
				<CustomSclResultDongWuLianAi :pageData="pageDataCommon" @posterLoadingCom="posterResultIsComplete=true">
				</CustomSclResultDongWuLianAi>
			</template>
			<template v-else-if="pageComp === 'fpacpt'">
				<CustomSclResultFpacpt :pageData="pageDataCommon"
					@posterLoadingCom="flag => posterResultIsComplete = flag" />
			</template>
			<template v-else-if="pageComp === 'animalforest'">
				<CustomSclResultAnimalForest :pageData="pageDataCommon"
					@posterLoadingCom="flag => posterResultIsComplete = flag" />
			</template>
			<template v-else-if="pageComp === 'bestxg'">
				<CustomSclResultBestxg :pageData="pageDataCommon"
					@posterLoadingCom="flag => posterResultIsComplete = flag" />
			</template>

			<template v-else-if="pageComp === 'goddess'">
				<CustomSclResultGoddess :pageData="pageDataCommon"
					@posterLoadingCom="flag => posterResultIsComplete = flag" />
			</template>

			<template v-else-if="pageComp === 'queen'">
				<CustomSclResultQueen :pageData="pageDataCommon"
					@posterLoadingCom="flag => posterResultIsComplete = flag" />
			</template>
			<template v-else-if="pageComp === 'mailun'">
				<CustomSclResultMaiLun :pageData="pageDataCommon" />
			</template>

			<view v-if="fanhuaData.flotImg" class="flot-info-wrapper"
				:style="{width:fanhuaData.floatW,height:fanhuaData.floatH}" @click="clickFloatImgHandle">
				<image class="img" :src="fanhuaData.flotImg" mode=""></image>
			</view>

			<template v-if="!isShowBottomBtn">
				<view class="checkup-mental-entry-box checkup-depression-entry-box"
					v-if="showAdsWrapper4 && sclReportType!=2">
					<CheckupDepressedEntry isResAd sourceType="18" />
				</view>
				<view class="checkup-mental-entry-box" v-if="showAdsWrapper3 && sclReportType!=2">
					<MentalHealthCheckupEntryVue :sty="{width:'664rpx',height:'202rpx',margin:'auto'}"
						sourceType="18" />
				</view>
				<scl-result-more :showAdsWrapper1="showAdsWrapper1" :showAdsWrapper2="showAdsWrapper2" :sclId="sclId"
					:discountType="discountType" :discountId="discountId" :discountNum="discountNum"
					:group="currentGroup" v-if="isShowRecommend && !reloadData  && sclReportType!=2"></scl-result-more>
			</template>
			<template>
				<view
					v-if="pageComp != 'pageQX'&&pageComp!='dongwulianai' && pageComp !== 'fpacpt' && pageComp !== 'animalforest' && pageComp !== 'bestxg'&& pageComp !== 'goddess' && pageComp !== 'queen'&& pageComp !== 'mailun'"
					style="height: 160rpx; width: 100%;"></view>
			</template>
			<template v-if="!showFullFloatImg">
				<template v-if="isShowBottomBtn">
					<BackToSclCheckup :type="sclReportType" :collectNums="collectNums" :isSclAllReport="isSclAllReport"
						@back="backHandle('scl-checkup')" :isShowHand="isShowHand" />
				</template>

				<template v-else>
					<template v-if="!reloadData&&teShuTestShowBottomShare">
						<cover-view class="bottom-box">
							<cover-view class="bb-share">
								<cover-view class="bb-share-text">
									<!-- <image class="share-tip-img" :src="staticImgs.shareTip" mode=""></image> -->
									<cover-image :src="scl_share" mode="" class="bb-share-img"></cover-image>
									<cover-view class="text">分享</cover-view>
								</cover-view>
								<!-- 不加文字不可点击 -->
								<button class="bb-share-btn" open-type="share">分享</button>
							</cover-view>
							<!--<template>-->
							<cover-view class="btns-wrapper">
								<cover-view class="bb-more-scl">
									<cover-image class="bb-more-scl-img" :src="bottomBtnBtnColor[0]"
										@click="goMoreScl" />
									<cover-view class="bb-more-scl-text" @click="goMoreScl">更多测评</cover-view>
								</cover-view>
								<cover-view class="bb-lx">
									<cover-image class="bb-lx-img" v-if="isShowMoreBtn" :src="bottomBtnBtnColor[1]"
										@click="showQrCode" />
									<cover-view class="bb-lx-text" @click="showQrCode">联系顾问</cover-view>
								</cover-view>
							</cover-view>
							<!--</template>-->
						</cover-view>
						<cover-view class="coupon-tip-position yiyuan-coupon-tip-position"
							v-if="discountType === 4 && repurchaseSwitch === 'on'">
							<cover-view class="coupon-tip-box topToBottomShake yiyuan-coupon-tip-box">
								<cover-image :src="staticImgs.yiyuanUseTip" class="coupon-tip-img" @click="goMoreScl" />
							</cover-view>
						</cover-view>
						<cover-view class="coupon-tip-position" v-else-if="discountId && repurchaseSwitch === 'on'">
							<cover-view class="coupon-tip-box topToBottomShake">
								<cover-image :src="staticImgs.couponTip" class="coupon-tip-img" @click="goMoreScl" />
								<cover-view class="coupon-tip-text"
									@click="goMoreScl">{{discountNumText}}待使用</cover-view>
							</cover-view>
						</cover-view>
					</template>
				</template>
			</template>
			<!--不加else不能隐藏-->
			<template v-else />
		</template>

		<!-- 弹窗 -->
		<template>
			<YiyuanDiscountModal :eshopDiscountList="eshopDiscountList" @confirm="couponModalVisible = false"
				:visible="couponModalVisible" />

			<NewDiscountModal @close="closeHandle" :visible="newCouponModalVisible" :discountNum="newDiscountNum" />

			<show-qr-code v-if="showQrCodeFlag" :qrCode="customerImg" @hide="hide"></show-qr-code>
			<PosterSclResultModal :fullType="fullType" @close="closePosterModalHandle" :visible="showFullFloatImg"
				:img="fanhuaData.resultImg" :type="moreType" :closeBtnImg="fanhuaData.closeBtnImg"
				:cBtnWidth="fanhuaData.cBtnWidth" :cBtnHeight="fanhuaData.cBtnHeight" :showBtn="posterCanHide"
				:config="modalConfig" />
			<!-- 预约订单弹框 -->
			<ExplanationOrderModal v-model="explanationOrderModalShow" is-result />
			<!--脉轮-->
			<MailunPopup v-model="mailunPopupShow" @close="backHandle" />
		</template>
		<!-- 弹窗 -->


		<image @click="toExplanation" class="explanation-img" :src="staticImgs.explanationBtn" mode="widthFix"
			v-if="isExistExplanationOrderModal" />

		<view style="position: fixed; top: -9999rpx">
			<!-- #ifdef MP-WEIXIN -->
			<canvas id="dcanvas" type="2d" style="zoom: 50%;width: 750px; height: 1360px;" />
			<!-- #endif -->
			<!-- #ifndef MP-WEIXIN -->
			<canvas canvas-id="dcanvas" id="dcanvas" style="zoom: 50%;width: 750px; height: 1360px;" />
			<!-- #endif -->
		</view>


	</view>
</template>

<script>
	import sclResultMore from '@/subcontractorB/components/scl-result-more/scl-result-more.vue'
	import uCharts from "@/subcontractorB/components/stan-ucharts/u-charts/u-charts.js";
	import {
		resultShow,
		get_scl_info,
		updateSclTalkTime,
		getUserAnsList,
		isEshopScl,
		showExplanation
	} from '@/common/api/scl_api.js'
	import {
		formatRichText
	} from '@/common/utils/util.js'
	import NewDiscountModal from '@/subcontractorB/components/NewDiscountModal.vue'

	import CustomSclResultA from './CustomSclResultA.vue'
	import CustomSclResultB from './CustomSclResultB.vue'
	import CustomSclResultMBTI from './CustomSclResultMBTI.vue'
	import CustomSclResultCommon from './CustomSclResultCommon.vue'
	import CustomSclResultPPCS from './CustomSclResultPPCS.vue'
	import CustomSclResultOLSON from './CustomSclResultOLSON.vue'
	import CustomSclResultBD from './CustomSclResultBD.vue'
	import CustomSclResultYLQYB from './CustomSclResultYLQYB.vue'
	import CustomSclResultOCEAN from './CustomSclResultOCEAN.vue'
	import CustomSclResultCRYL from './CustomSclResultCRYL.vue'
	import CustomSclResult3TO1YY from './CustomSclResult3TO1YY.vue'
	import CustomSclResultQX from './CustomSclResultQX.vue'
	import CustomSclResultFpacpt from './CustomSclResultFpacpt.vue'
	import AddedServiceMbtiResultVue from './added-service-mbti-result.vue';
	import CustomSclResultDongWuLianAi from './CustomSclResultDongWuLianAi.vue'

	import YiyuanDiscountModal from '@/components/YiyuanDiscountModal.vue'
	import BackToSclCheckup from './BackToSclCheckup.vue';

	import MentalHealthCheckupEntryVue from "@/components/MentalHealthCheckupEntry.vue";
	import CheckupDepressedEntry from '@/components/CheckupDepressedEntry.vue'
	import CustomSclResultAnimalForest from './CustomSclResultAnimalForest.vue'
	import CustomSclResultBestxg from './CustomSclResultBestxg.vue'
	import CustomSclResultGoddess from './CustomSclResultGoddess.vue'
	import CustomSclResultQueen from './CustomSclResultQueen.vue'
	import CustomSclResultMaiLun from './CustomSclResultMaiLun.vue'


	import {
		getAppDictConfig,
		getQrcodeUrl
	} from '@/common/api/index_api.js'
	import {
		saveLocalImg
	} from '@/common/utils/util.js'
	import {
		useDrawPoster
	} from '@/components/u-draw-poster'

	import {
		mapState,
		mapGetters
	} from 'vuex'
	import {
		unescape
	} from '@/common/utils/util.js'

	import PosterSclResultModal from '@/subcontractorB/components/PosterSclResultModal.vue'
	import navigationBar from "@/components/navigationBar/navigationBar.vue"
	import ExplanationOrderModal from "@/components/ExplanationOrderModal/ExplanationOrderModal.vue";
	import MailunEntry from '@/components/MailunEntry.vue'
	import MailunPopup from '@/components/MailunPopup.vue'

	var _self
	var canvaPie = null

	export default {
		components: {
			ExplanationOrderModal,
			BackToSclCheckup,
			sclResultMore,
			NewDiscountModal,
			CustomSclResultA,
			CustomSclResultB,
			CustomSclResultMBTI,
			CustomSclResultCommon,
			CustomSclResultPPCS,
			CustomSclResultOLSON,
			PosterSclResultModal,
			navigationBar,
			CustomSclResultBD,
			CustomSclResultYLQYB,
			CustomSclResultOCEAN,
			CustomSclResultCRYL,
			YiyuanDiscountModal,
			MentalHealthCheckupEntryVue,
			AddedServiceMbtiResultVue,
			CustomSclResult3TO1YY,
			CustomSclResultQX,
			CheckupDepressedEntry,
			CustomSclResultDongWuLianAi,
			CustomSclResultFpacpt,
			CustomSclResultAnimalForest,
			CustomSclResultBestxg,
			CustomSclResultGoddess,
			CustomSclResultQueen,
			CustomSclResultMaiLun,
			MailunEntry,
			MailunPopup
		},
		data() {
			return {
				isSclAllReport: 'Y',
				collectNums: '',
				posterResultIsComplete: false,
				moreType: 0,
				navigationBarDataInfo: {
					"bg_color": "#fff",
					"color": "#333",
					"flag": 1,
					"name": "测评结果",
					"hasEntity": true,
				},
				isShowHand: false,
				scl_jdcpbg: this.imgBaseURL + '/scl/scl_jdcpbg.png', //解读测评报告提示
				scl_save_result: this.imgBaseURL + '/scl/scl_save_result.png', //保存结果图标
				scl_share: this.imgBaseURL + '/scl/scl_share.png', //分享
				report_scl_title_bg: this.imgBaseURL + '/scl/report_scl_title_bg.png', //测评标题背景
				report_title: this.imgBaseURL + '/scl/report_title.png', //报告图片
				report_top_title: this.imgBaseURL + '/scl/report_top_title.png', //顶部背景
				staticImgs: {
					titBg: this.imgBaseURL + '/sclResult/scl_result_tit_bg.png',
					btn1: this.imgBaseURL + '/sclResult/scl_result_btn1.png',
					btn2: this.imgBaseURL + '/sclResult/scl_result_btn2.png',
					btn3: this.imgBaseURL + '/sclResult/scl_result_btn3.png',
					richTextTit: this.imgBaseURL + '/sclResult/scl_result_richtext_tit.png',
					couponTip: this.imgBaseURL + '/scl/scl_ coupon_modal_bg_5.png',
					shareTip: this.imgBaseURL + '/scl/share-tip-img.png', //分享
					yiyuanUseTip: this.imgBaseURL + '/scl/yiyuan-modal/yiyuan-use-tip.png',
					contactBg: this.imgBaseURL + '/sclResult/contact1.png',
					contactBg2: this.imgBaseURL + '/sclResult/contact2.png',
					moreBg: this.imgBaseURL + '/sclResult/more1.png',
					moreBg2: this.imgBaseURL + '/sclResult/more2.png',
					explanationBtn: this.imgBaseURL + '/explanation-btn.png'
				},
				defaultQrcode: this.imgBaseURL + '/scl/default_miniapp_qrcode_new.png',
				cWidth: '',
				cHeight: '',
				pixelRatio: .9,
				score: '',
				isScore: false,
				resultSetMap: [],
				setMap: [],
				isCanvasBox: false,
				showQrCodeFlag: false,
				modalConfig: {},
				detail: null,
				customerImg: this.imgBaseURL + '/customer/customer_001.png?' + Math.random(),
				addSclWay: '', //  1电商测评   其它普通测评
				shareData: {
					title: '万心测心理为您的心理健康保驾护航',
					path: '/pages/index/index',
					imageUrl: this.imgBaseURL + '/img_index_share_yu_yue.jpg?' + Math.random(),
					desc: '',
					content: ''
				},
				renderResultData: [],
				isShowRecommend: true,
				sclId: '',
				reportId: '',
				couponModalVisible: false,
				newCouponModalVisible: false,
				reloadData: false,
				pageDataA: null,
				pageDataB: null,
				pageDataMBTI: null,
				pageDataCommon: null,
				nextId: '',
				scl3To1FristTit: '',
				pageComp: 'normla', // normla,pageA - 贝克,pageSCL90 - SCL90,pageMBTI - MBTI
				fanhuaData: {
					floatImg: '',
					resultImg: ''
				}, //繁花测评和x03新年测评的特定data，有个浮窗 点击后会出现长按保存的图片
				showFullFloatImg: false,
				fullType: '', //'fanhua' , 'x02'
				sclReportDetail: '',
				showCanvas: true,
				isEshopScl: false,
				newDiscountNum: 0,
				isShowMoreBtn: true,
				isInitOk: false,
				sclReportType: 0,
				showAdsWrapper1: true,
				showAdsWrapper2: true,
				showAdsWrapper3: true,
				showAdsWrapper4: true,
				fromHistory: false,
				eshopDiscountList: '',
				overHide: false,
				actGroup: '',
				isScl90: false,
				addSclWay: '',
				resPageBgColor: '',
				// posterCanHide:true,
				isShowPage: false,
				checkMoreBtn: false,
				checkUpShowAdsFlag: true,
				showBackBtn: false,
				reportRedirect: undefined,
				repurchaseSwitch: 'off',
				explanationOrderModalShow: false,
				isExistExplanationOrderModal: false,
				explanationState: undefined,
				mailunPopupShow: false,
				fistMailunPopupShow: true,
				isFirstBack: true
			}
		},
		computed: {
			...mapGetters('user', ['discountA', 'discountB', 'discountC', 'clientUserUid']),
			...mapState({
				currentGroup: state => state.user.currentGroup,
				discountNum: state => state.user.discountNum,
				discountTime: state => state.user.discountTime,
				discountId: state => state.user.discountId,
				discountType: state => state.user.discountType,
				showExplanation: state => state.app.showExplanation
			}),
			pageBgColor() {
				if (this.pageComp == 'pageCRYL') {
					return '#FFEEF0'
				} else if (this.resPageBgColor) {
					return this.resPageBgColor
				} else {
					return '#F9F9F9'
				}

			},
			bottomBtnBtnColor() {
				return this.pageComp == 'pageCRYL' ? [this.staticImgs.moreBg2,
					this.staticImgs.contactBg2
				] : [this.staticImgs.moreBg, this.staticImgs.contactBg]
			},
			posterCanHide() {
				return this.nextId == '' || (this.nextId && !this.fromHistory)
			},
			discountNumText() {
				return this.discountNum == 10 ? '0元' : `${this.discountNum}折`
			},
			isA() {
				return this.currentGroup == 'A'
			},
			currentTitBg() {
				return this.isA ? this.report_scl_title_bg : this.staticImgs.titBg
			},
			currentTitImg() {
				return this.isA ? this.report_title : this.staticImgs.richTextTit
			},
			isShowChart() {
				return this.isCanvasBox && !this.showQrCodeFlag && !this.couponModalVisible
			},
			isShowPageTj() {
				return this.detail || this.pageDataA || this.pageDataB || this.pageDataMBTI || this.pageDataCommon
			},
			isShowBottomBtn() {
				return this.sclReportType || (this.actGroup == 'base' && this.sclReportType != 2) || this.showBackBtn
			},
			isResultSpeicalCustom() {
				//结果如恋爱九宫格这女王驾到等结果页完全定制无法通用的单独处理逻辑
				return this.pageComp != 'pageQX' && this.pageComp != 'dongwulianai' && this.pageComp !== 'fpacpt' && this
					.pageComp !== 'animalforest' && this.ageComp !== 'bestxg' && this.pageComp !== 'goddess' && this
					.pageComp !== 'queen' && this.pageComp !== 'mailun'
			},
			teShuTestShowBottomShare() {
				if (this.pageComp == 'dongwulianai') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'fpacpt') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'animalforest') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'bestxg') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'goddess') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'queen') {
					if (this.posterResultIsComplete) {
						return true
					} else {
						return false
					}
				} else if (this.pageComp == 'mailun') {
					return false
				} else {
					return true
				}
			}
		},
		watch: {
			isShowPageTj(val) {
				if (val) {
					this.isShowPage = true
				}
			},
			discountNum(val, old) {
				this.reloadData = true
				this.$nextTick(() => {
					this.reloadData = false
				})
			},
			couponModalVisible(val) {
				this.overHide = val
			}
		},
		onLoad(options) {
			this.fromHistory = options.fromHistory
			this.reportRedirect = options.reportRedirect
			console.log(options, '------onLoad')
			uni.showLoading()
			_self = this;
			this.cWidth = uni.upx2px(750);
			this.cHeight = uni.upx2px(500);

			this.reportId = options.id || options.reportId
			this.addSclWay = options.addSclWay

			uni.setStorageSync('adClickId', '') //清除用于广告投放，数据上报的跟踪id
			this.sclReportType = options.sclReportType != 'undefined' ? options.sclReportType : 0
			if (this.reportRedirect) {
				if (this.reportRedirect === 'checkup' || this.reportRedirect === 'checkup-list') {
					this.sclReportType = '1'
				} else if (this.reportRedirect === 'depression') {
					this.sclReportType = '2'
				} else if (this.reportRedirect === 'sexuality') {
					this.sclReportType = '3'
				}
			}
			console.log(this.sclReportType, '---this.sclReportType--')
			this.getExplanationModalShow()
			this.showBackBtn = options.showBackBtn
			this.actGroup = options.actGroup

			const tmpFrom = uni.getStorageSync('from')
			if (tmpFrom == 'afterPayScl90Page') {
				uni.removeStorageSync('from')
			}

			this.getResult(options.id)
			this.$store.dispatch('user/getUserInfo')
			this.couponInit()

			if (this.isShowMoreBtn) {
				if (this.moreType == 3 || this.checkMoreBtn) {
					this.$u.api.getCloseMoreSclUrl().then(({
						data: res
					}) => {
						this.isShowMoreBtn = res.data == 'Y'
					})
				}
			}

			uni.hideLoading()

			this.isInitOk = true

		},
		onShow() {
			uni.setStorageSync('mailunPopupShow', true)
			console.log('------onShow')

			if (!this.isInitOk) {
				//如果未初始化完成，则不执行
				return false
			}

			this.couponInit()
			this.getExplanationModalShow()
		},
		onReachBottom() {
			this.isShowHand = true;
		},
		methods: {
			backHandle(type) {
				const mailunBack = () => {
					// if (this.isResultSpeicalCustom && this.fistMailunPopupShow) {
					// 	this.fistMailunPopupShow = false
					// 	this.mailunPopupShow = true
					// 	return false
					// }
					return true
				}
				console.log(type, '-----scl-checkup------')
				console.log(this.sclReportType, '----this.sclReportType')
				// this.sclReportType = '1'
				if (this.sclReportType || this.showBackBtn) {

					// 获取一下上一页的url，如果是体检中心则只是返回即可
					let pages = getCurrentPages()

					let url
					let prePage
					if (pages.length > 1) {
						prePage = pages[pages.length - 2]
						url = prePage.route
					}
					console.log(url, '---url---')

					console.log(1, '---back---')

					if (this.sclReportType == 3) {
						if (url == 'subcontractorC/pages/sexuality-assessment/index') {
							if (mailunBack()) {
								uni.navigateBack()
							}
						} else {
							if (this.isSclAllReport == 'N') {
								if (type === 'scl-checkup') {
									uni.navigateTo({
										url: '/subcontractorD/pages/sclCheckUpLoadPage/sclCheckUpLoadPage?sourceType=30&from=result&loadPageTit=' +
											this.shareData.title + '&sclId=' + this.sclId + '&reportId=' + this
											.reportId + '&sclReportType=' + this.sclReportType
									})
								} else if (mailunBack()) {
									uni.navigateBack()
								}
							} else {
								if (mailunBack()) {
									uni.redirectTo({
										url: '/subcontractorC/pages/sexuality-assessment/index?sourceType=30'
									})
								}
							}
						}
					} else if (this.sclReportType == 2) {
						if (url == 'subcontractorC/pages/checkupDepressed/index') {
							// uni.$emit('update-checkup-depressed',{sourceType:30})
							if (mailunBack()) {
								uni.navigateBack()
							}
						} else {
							if (this.isSclAllReport == 'N') {
								if (type === 'scl-checkup') {
									uni.navigateTo({
										url: '/subcontractorD/pages/sclCheckUpLoadPage/sclCheckUpLoadPage?sourceType=30&from=result&loadPageTit=' +
											this.shareData.title + '&sclId=' + this.sclId + '&reportId=' + this
											.reportId + '&sclReportType=' + this.sclReportType
									})
								} else if (mailunBack()) {
									uni.navigateBack()
								}
							} else {
								if (mailunBack()) {
									uni.redirectTo({
										url: '/subcontractorC/pages/checkupDepressed/index?sourceType=30'
									})
								}
							}
						}
					} else if (this.sclReportType == 1) {
						console.log(2, '---back---')
						if (url == 'subcontractorC/pages/sclCheckup/sclCheckup') {
							// uni.$emit('update-sclCheckup',{sourceType:30})
							if (mailunBack()) {
								uni.navigateBack();
							}
						} else if (this.isScl90) {
							console.log(3, '---back---')
							if (this.isSclAllReport == 'N') {
								console.log(4, '---back---')
								if (type === 'scl-checkup') {
									// if (this.addSclWay && this.addSclWay == '1') {
									// 	this.orderPay();
									// } else {
									// 	uni.navigateTo({
									// 		url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									// 	})
									// }
									//原来先进入加载页面
									// uni.redirectTo({
									// 	url: '/subcontractorD/pages/sclCheckUpLoadPage/sclCheckUpLoadPage?sourceType=30&loadPageTit=' +
									// 		this.shareData.title + '&sclId=' + this.sclId + '&reportId=' + this
									// 		.reportId + '&sclReportType=' + this.sclReportType
									// })
									uni.navigateTo({
										url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									})
								} else if (mailunBack()) {
									console.log('4-1', '---back---')
									if (this.isFirstBack) {
										this.isFirstBack = false;
										uni.navigateTo({
											url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
										})
									} else {
										uni.navigateBack()
									}
								}
							} else {
								console.log(5, '---back---')
								if (mailunBack()) {
									uni.redirectTo({
										url: `/subcontractorC/pages/sclCheckup/sclCheckup?sourceType=30&from=result`
									})
								}
							}
						} else {
							if (this.isSclAllReport == 'N') {
								console.log(6, '---back---')
								if (type === 'scl-checkup') {
									// if (this.addSclWay && this.addSclWay == '1') {
									// 	this.orderPay();
									// } else {
									// 	uni.navigateTo({
									// 		url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									// 	})

									// }
									//原来先进入加载页面
									// uni.redirectTo({
									// 	url: '/subcontractorD/pages/sclCheckUpLoadPage/sclCheckUpLoadPage?sourceType=30&loadPageTit=' +
									// 		this.shareData.title + '&sclId=' + this.sclId + '&reportId=' + this
									// 		.reportId + '&sclReportType=' + this.sclReportType
									// })
									uni.navigateTo({
										url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									})
								} else if (mailunBack()) {
									if (this.isFirstBack) {
										this.isFirstBack = false;
										uni.navigateTo({
											url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
										})
									} else {
										uni.navigateBack()
									}
								}
							} else {
								console.log(7, '---back---')
								if (mailunBack()) {
									uni.redirectTo({
										url: `/subcontractorC/pages/sclCheckup/sclCheckup?sourceType=30`
									})
								}
							}

						}
					} else if (type === 'scl-checkup' && this.reportRedirect) {
						if (this.reportRedirect === 'checkup' || this.reportRedirect === 'checkup-list') {
							if (url == 'subcontractorC/pages/sclCheckup/sclCheckup') {
								console.log(8, '---back---')
								if (mailunBack()) {
									uni.navigateBack();
								}
							} else {
								console.log(9, '---back---')
								if (this.isSclAllReport == 'N') {
									// if (this.addSclWay && this.addSclWay == '1') {
									// 	this.orderPay();
									// } else {
									// 	uni.navigateTo({
									// 		url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									// 	})

									// }
									// 原来先进入加载页面
									uni.redirectTo({
										url: '/subcontractorD/pages/sclCheckUpLoadPage/sclCheckUpLoadPage?sourceType=30&loadPageTit=' +
											this.shareData.title + '&sclId=' + this.sclId + '&reportId=' + this
											.reportId + '&sclReportType=' + this.sclReportType
									})
									uni.navigateTo({
										url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${this.sclId}&reportId=${this.reportId}`
									})
								} else {
									console.log(10, '---back---')
									if (mailunBack()) {
										uni.redirectTo({
											url: `/subcontractorC/pages/sclCheckup/sclCheckup?sourceType=30`
										})
									}
								}
							}
						} else if (this.reportRedirect === 'depression') {
							if (url == 'subcontractorC/pages/checkupDepressed/index') {
								// uni.$emit('update-checkup-depressed',{sourceType:30})
								if (mailunBack()) {
									uni.navigateBack()
								}
							} else {
								if (mailunBack()) {
									uni.redirectTo({
										url: '/subcontractorC/pages/checkupDepressed/index?sourceType=30'
									})
								}
							}
						} else if (this.reportRedirect === 'sexuality') {

							if (url == 'subcontractorC/pages/sexuality-assessment/index') {
								// uni.$emit('update-sexuality',{sourceType:30})
								if (mailunBack()) {
									uni.navigateBack()
								}
							} else {
								if (mailunBack()) {
									uni.redirectTo({
										url: '/subcontractorC/pages/sexuality-assessment/index?sourceType=30'
									})
								}
							}
						}
					} else if (getCurrentPages().length > 1) {
						console.log(11, '---back---')
						if (mailunBack()) {
							uni.navigateBack()
						}
					}
				} else if (!this.isShowMoreBtn) {
					console.log(12, '---back---')
					if (mailunBack()) {
						uni.reLaunch({
							url: '/pages/sclList/sclList'
						})
					}
				} else if (getCurrentPages().length > 1) {
					console.log(13, '---back---')
					if (mailunBack()) {
						uni.navigateBack()
					}
				} else {
					console.log(14, '---back---')
					if (mailunBack()) {
						uni.reLaunch({
							url: '/pages/sclList/sclList'
						})
					}
				}
			},
			closePosterModalHandle() {
				this.showFullFloatImg = false
			},
			clickFloatImgHandle() {
				this.showFullFloatImg = true
			},
			processResultDataToRenderDataCOPE(dData, mainResultD) {
				this.pageComp = 'pageOCEAN'
				//维度信息
				let tmpScoreArr = []
				//最终结论
				let conclusion = ''
				//常模数据
				let commonModelData = []
				//常模对象
				let normComparison = null
				//建议
				let suggestions = null
				//结果详解
				let detailedResults = {
					contentArr: []
				}

				let mainImg = ''

				let tmpPushResultArr = []

				const myRadarDataStrArr = []
				const myRadarDataScoreArr = []
				console.log(mainResultD, '=====mainResultD====')

				if (mainResultD.useMultipleGroupScore) {
					const {
						conditions,
						scoreRule
					} = mainResultD.groupInfo
					// let scoreRuleArr = scoreRule.split(',')
					conditions.forEach((item, index) => {
						item.val = item.val.split(',')
						item.count = 0
					})

					dData.resultList.map((item, index) => {
						myRadarDataStrArr.push(item.dmnsName)
						myRadarDataScoreArr.push(item.score)
						conditions.forEach((cItem, cIndex) => {
							if (cItem.val.indexOf(item.dmnsName) != -1) {
								cItem.count += item.score
							}
						})
					})

					const finalScore = conditions[0].count - conditions[1].count

					if (finalScore > 0) {
						conclusion = mainResultD.conclusionResultArr[0].conclusion
						detailedResults = mainResultD.conclusionResultArr[0].detailedResults
					} else if (finalScore = 0) {
						conclusion = mainResultD.conclusionResultArr[1].conclusion
						detailedResults = mainResultD.conclusionResultArr[1].detailedResults
					} else if (finalScore < 0) {
						conclusion = mainResultD.conclusionResultArr[2].conclusion
						detailedResults = mainResultD.conclusionResultArr[2].detailedResults
					}

				}

				console.log(mainResultD,
					'===============================mainResultDmainResultDmainResultDmainResultDmainResultD')
				console.log(mainResultD.sciencePopularization, '-------mainResultD.sciencePopularization----')
				//雷达图信息
				let radarData = null
				if (mainResultD.hasRadarGraph) {
					if (!myRadarDataStrArr[0]) {
						//去除总分的雷达信息
						myRadarDataStrArr.shift()
						myRadarDataScoreArr.shift()
					}
					console.log(myRadarDataStrArr, '-------myRadarDataStrArr')
					radarData = {
						"categories": myRadarDataStrArr,
						"series": [{
							"name": "数据",
							"color": "#FEB069",
							"data": myRadarDataScoreArr,
							"index": 0,
							"pointShape": "square",
							"show": true,
							"labelShow": false,
							"textColor": "rgba(0,0,0,1)",
							"type": "radar"
						}],
						"legend": {
							"show": false
						},
					}

				}

				dData.createDate = Number(dData.createDate)

				if (tmpPushResultArr && tmpPushResultArr.length > 0) {
					detailedResults.contentArr = [...detailedResults.contentArr, ...tmpPushResultArr]
					console.log(detailedResults.contentArr, '=============detailedResults.contentArr')
				}

				console.log(mainResultD.sciencePopularization, '-------mainResultD.sciencePopularization----')

				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					firstScore: dData.resultList && dData.resultList[0] && dData.resultList[0].score,
					radarData,
					dimensionsType: mainResultD.dimensionsType,
					scoreInfoType: mainResultD.scoreInfoType,
					hasRadarGraph: mainResultD.hasRadarGraph,
					literatrue: mainResultD.literatrue,
					sciencePopularization: mainResultD.sciencePopularization,
					detailedResults,
					conclusion,
					suggestions,
					radarMax: mainResultD.radarMax,
					mainImg,
					normComparison,
					imgAndScoreBlockType: mainResultD.imgAndScoreBlockType,
					otherTipText: mainResultD.otherTipText,
					otherTipImg: mainResultD.otherTipImg,
					scoreInfoRightStr: mainResultD.scoreInfoRightStr,
				}
			},
			async couponInit() {
				if (this.repurchaseSwitch !== 'on') {
					// 活动测评 复购开关打开才弹优惠券
					return
				}
				if (uni.getStorageSync('getYiyuanCoupon')) {
					uni.removeStorageSync('getYiyuanCoupon')

					this.$nextTick(() => {
						this.couponModalVisible = true
						this.showCanvas = false
					})

				} else {
					const couponObj = uni.getStorageSync('newCouponInfo')
					uni.removeStorageSync('newCouponInfo')
					if (couponObj) {
						this.newDiscountNum = couponObj.couponNum
						this.$nextTick(() => {
							this.newCouponModalVisible = true
							this.showCanvas = false
						})
					}
				}
			},
			goMoreScl() {
				uni.reLaunch({
					url: '/pages/sclList/sclList'
				})
			},
			initRichText(text) {
				console.log(text, '=====text')
				return formatRichText(text);
			},
			determineSexualOrientation(scoreData, algorithmJson) {
				// 解析算法 JSON 数据
				// const algorithmData = algorithmJson//JSON.parse(algorithmJson)

				// 获取算法结果数组
				const resultArr = algorithmJson.resultArr

				// 遍历结果数组
				for (const item of resultArr) {
					// 获取当前项的键和对应的结果
					const key = item.key
					const result = item.result

					// 获取当前项对应的条件
					const conditions = item.Algorithm.split("&")
					console.log("conditions:", conditions)

					// 判断当前得分是否符合条件
					let satisfyCondition = true
					for (const condition of conditions) {
						const [sex, scoreRange] = condition.split("=")
						console.log("sex:", sex)
						console.log("scoreRange:", scoreRange)
						const [minScore, maxScore] = scoreRange.match(/\d+/g)
						console.log("minScore:", minScore)
						console.log("maxScore:", maxScore)

						// 查找同性或异性得分
						const scoreItem = scoreData.find(item => item.dmnsName === (sex === "同性取向" ? "同性取向" : "异性取向"))
						console.log("scoreItem:", scoreItem)
						if (!scoreItem || parseInt(scoreItem.myScore) < parseInt(minScore) || parseInt(scoreItem.myScore) >
							parseInt(maxScore)) {
							satisfyCondition = false
							break
						}
					}

					// 如果满足条件，则返回对应的性取向结果
					if (satisfyCondition) {
						return result
					}
				}

				// 如果没有匹配的条件，则返回未知
				return "未知"
			},

			async useAllCustomAlgorithmToMainConculsion(mainAlgorithmJson) {
				//todo：算法是否可用eval函数直接执行，或者云函数调用，将计算结果的算法交给运营人员自行录入

				//先拉取接口，获得该报告的答题记录
				const {
					data: dRes
				} = await getUserAnsList({
					reportId: this.reportId
				})
				const answerRecord = dRes.data
				answerRecord.unshift({}) // 为了方便计算，添加一个空对象
				console.log(answerRecord, '------answerRecord------')
				//mock 假设返回值是
				const mockAnswer = [{
					sortNum: 1,
					score: 0,
					content: '20点及20点之前'
				}, {
					sortNum: 2,
					score: 1,
					content: '16~30分'
				}, {
					sortNum: 4,
					score: 0,
					content: '8点'
				}, {
					sortNum: 1,
					score: 0,
					content: '>7小时'
				}, {
					sortNum: 1,
					score: 0,
					content: '无'
				}, {
					sortNum: 1,
					score: 0,
					content: '无'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '较好'
				}, {
					sortNum: 2,
					score: 1,
					content: '1-2次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '1-2次/周'
				}, {
					sortNum: 2,
					score: 1,
					content: '偶尔有'
				}]

				// 定义维度信息和算法
				const dimensions = {
					"睡眠质量": {
						questions: [15],
						calculateScore: function(answers) {
							// console.log(answers,'------answers-----')
							return answers[15].score
						}
					},
					"入睡时间": {
						questions: [2, 5],
						calculateScore: function(answers) {

							let total = answers[2].score + answers[5].score
							// console.log(total,'-----入睡时间-total')
							let mTotal = Math.ceil(total / 2)
							// 若累加分为“0”计0分，“1~2”计1分，“3~4”计2分，“5~6”计3分
							if (mTotal == 0) {
								return 0
							} else if (mTotal >= 1 && mTotal <= 2) {
								return 1
							} else if (mTotal >= 3 && mTotal <= 4) {
								return 2
							} else {
								return 3
							}
						}
					},
					"睡眠时间": {
						questions: [4],
						calculateScore: function(answers) {
							// “>7小时”计0分，“6~7”计1分，“5~6”计2分，“<5小时”计3分
							if (answers[4].score > 7) {
								return 0
							} else if (answers[4].score >= 6 && answers[4].score <= 7) {
								return 1
							} else if (answers[4].score >= 5 && answers[4].score <= 6) {
								return 2
							} else {
								return 3
							}
						}
					},
					"睡眠效率": {
						questions: [1, 3, 4],
						calculateScore: function(answers) {
							let bedtime = answers[1].score
							if (bedtime > 12) {
								bedtime = 24 - bedtime
							}
							let wakeTime = answers[3].score
							let sleepTime = answers[4].score
							// console.log("bedtime:", bedtime)
							let bedtimeHours = bedtime + wakeTime
							// console.log("bedtimeHours:", bedtimeHours)
							let sleepEfficiency = sleepTime / bedtimeHours * 100
							if (sleepEfficiency > 85) {
								return 0
							} else if (sleepEfficiency >= 75 && sleepEfficiency <= 84) {
								return 1
							} else if (sleepEfficiency >= 65 && sleepEfficiency <= 74) {
								return 2
							} else {
								return 3
							}
						}
					},
					"睡眠障碍": {
						questions: [6, 7, 8, 9, 10, 11, 12, 13, 14],
						calculateScore: function(answers) {
							let total = answers[6].score + answers[7].score + answers[8].score + answers[9]
								.score + answers[10]
								.score + answers[11].score + answers[12].score + answers[13].score + answers[
									14].score
							return Math.ceil(total / 9)
						}
					},
					"催眠药物": {
						questions: [16],
						calculateScore: function(answers) {
							return answers[16].score
						}
					},
					"日间功能障碍": {
						questions: [8, 9],
						calculateScore: function(answers) {
							let total = answers[8].score + answers[9].score
							return Math.ceil(total / 2)
						}
					}
				}

				// 计算总分
				const calculateTotalScore = (answers) => {
					let totalScore = 0;
					for (let dimension in dimensions) {
						let score = dimensions[dimension].calculateScore(answers);
						console.log(dimension, score)
						totalScore += score;
					}
					return totalScore;
				}

				const totalScore = calculateTotalScore(answerRecord);
				const tmpArr = [{
					dmnsName: "总分",
					qujian: "1000",
					myScore: totalScore
				}]

				const finalMainResult = this.calculateConclusion(mainAlgorithmJson, tmpArr)
				console.log(finalMainResult, '=========finalMainResult')
				finalMainResult.tmpScoreArr = [{
					score: totalScore,
					label: "睡眠质量",
					conclusion: finalMainResult.shortStr,
					healthScore: "<=4"
				}]



				console.log("总分:", totalScore);
				return finalMainResult

				// console.log(finalMainResult,'=========finalMainResult')
				// console.log(mockAnwser,'-----mockAnwser')
			},
			async processResultDataToRenderDataYLQYB(dData, mainResultD) {
				this.pageComp = 'pageYLQYB'
				this.resPageBgColor = ''
				const result = dData.resultList[0]

				let obj = {}
				try {
					obj = JSON.parse(result.resultDesc)
					const tmpReusltImg = await this.createChipCanvas(obj.modalImg, {
						x: 112,
						y: 1440
					}, 'p=2@id=' + this.sclId)
					this.fanhuaData = {
						flotImg: obj.floatImg,
						resultImg: tmpReusltImg,
						floatW: obj?.floatImgPosition?.width || '106rpx',
						floatH: obj?.floatImgPosition?.height || '90rpx',
					}
					this.resPageBgColor = obj.resPageBgColor || '#babcf0'

					this.modalConfig = {
						modalCloseBtnImg: obj.modalCloseBtnImg,
						modalCloseBtnsty: obj.modalCloseBtnsty,
						tipSty: obj.tipSty,
						modalBottomMask: obj.modalBottomMask,
						useDiv: true
					}

					this.showFullFloatImg = true
				} catch (e) {
					console.log(e, '-----e')
				}

				this.pageDataCommon = {
					resImg: obj.resImg
				}
			},
			async processResultDataToRenderDataOCEAN(dData, mainResultD) {
				this.pageComp = 'pageOCEAN'
				//维度信息
				let tmpScoreArr = []

				//最终结论
				let conclusion = ''

				let subConclusion = ''

				//常模数据
				let commonModelData = []

				//常模对象
				let normComparison = null

				//建议
				let suggestions = null

				let totalScore = 0

				let tmpSciencePopularization = null

				//结果详解
				let detailedResults = {
					contentArr: []
				}

				let mainImg = ''

				let tmpPushResultArr = []
				// const tmpResultContentArr = []

				const myRadarDataStrArr = []
				const myRadarDataScoreArr = []
				console.log(mainResultD, '=====mainResultD====1111')

				if (mainResultD.cutIndex) {
					//根据score,由大到小排序，然后截取
					dData.resultList = dData.resultList.sort((a, b) => b.score - a.score)
					dData.resultList = dData.resultList.slice(0, mainResultD.cutIndex)
				}


				if (mainResultD.useCustomAlgorithmToMainConculsion) {
					const conclusionObj = this.calculateConclusion(mainResultD.mainAlgorithmJson, dData.resultSetMap)
					if (conclusionObj) {
						console.log(conclusionObj, '=======conclusionObj')
						conclusion = conclusionObj.conclusion
						subConclusion = conclusionObj.subConclusion
						tmpPushResultArr = conclusionObj.detailedResults.contentArr
						suggestions = conclusionObj.detailedResults.suggestions
						mainImg = conclusionObj.mainImg
					}
				} else if (mainResultD.useAllCustomAlgorithmToMainConculsion) {
					const conclusionObj = await this.useAllCustomAlgorithmToMainConculsion(mainResultD
						.mainAlgorithmJson)
					console.log(conclusionObj, '------obj')
					conclusion = conclusionObj.conclusion
					subConclusion = conclusionObj.subConclusion
					tmpPushResultArr = conclusionObj.detailedResults.contentArr
					suggestions = conclusionObj.detailedResults.suggestions
					mainImg = conclusionObj.mainImg
					tmpScoreArr = conclusionObj.tmpScoreArr
					normComparison = conclusionObj.detailedResults.normComparison

					// console.log(conclusionObj,'------obj')
					console.log('-----useAllCustomAlgorithmToMainConculsion -----')
				}

				if (mainResultD.useHighestScoreDimensionResult) {
					// 使用最高分值维度的结果
					console.log('----- mainResultD.useHighestScoreDimensionResult -----')
					const findHighestScore = (arr) => {
						if (arr.length === 0) {
							return null; // 返回 null 表示数组为空
						}

						let highestIndex = 0
						let highestScore = arr[highestIndex].myScore // 假设第一个元素是分值最高的
						for (let i = 1; i < arr.length; i++) {
							if (arr[i].myScore > highestScore) {
								highestScore = arr[i].myScore // 更新分值最高的元素
								highestIndex = i
							}
						}
						return arr[highestIndex] // 返回分值最高的元素
					}
					const finalObj = findHighestScore(dData.resultSetMap)
					console.log(finalObj, '---------finalObj')

					dData.resultList.map((item, index) => {
						if (item.dmnsName == finalObj.dmnsName) {

							const tmpObj = JSON.parse(unescape(item.resultDesc))
							detailedResults = tmpObj.detailedResults || {
								contentArr: []
							}
							conclusion = tmpObj.conclusion
							subConclusion = tmpObj.subConclusion
						}

						if (mainResultD.hasRadarGraph) {
							myRadarDataStrArr.push(item.dmnsName)
							myRadarDataScoreArr.push(item.score)
						}
					})

				} else if (mainResultD.dimensionsType == '1' && !mainResultD.useAllCustomAlgorithmToMainConculsion) {
					tmpScoreArr = dData.resultList.map((item, index) => {
						console.log(item, '=======item')
						if (index === 0) {
							if (mainResultD.useFirstResultConclusion) {
								totalScore = item.score
								console.log(item.resultDesc, '===item.resultDesc')
								const tmpObj = JSON.parse(unescape(item.resultDesc))
								conclusion = tmpObj.conclusion
								subConclusion = tmpObj.subConclusion
								tmpSciencePopularization = tmpObj.sciencePopularization
								detailedResults = tmpObj.detailedResults || {}
								console.log(tmpObj.suggestions, '===========tmpObj.suggestions')
								// 判断tmpObj.suggestions是否是对象

								try {
									suggestions = tmpObj.suggestions ? JSON.parse(tmpObj.suggestions) : null
								} catch (e) {
									suggestions = this.$lodash.isObject(tmpObj.suggestions) ? tmpObj
										.suggestions : null
								}
								suggestions = this.$lodash.isEmpty(suggestions) ? null : suggestions
							} else if (mainResultD.useCustomAlgorithmResults) {
								console.log('使用自定义算法计算')

								// const tmpObj = JSON.parse(unescape(item.resultDesc))
								const finalMainResult = this.determineSexualOrientation(dData.resultSetMap,
									mainResultD
									.algorithmJson)
								console.log(finalMainResult, '=========finalMainResult')
								conclusion = '您的性取向是：' + finalMainResult.conclusion
								detailedResults = finalMainResult.detailedResults
								mainImg = finalMainResult.mainImg
								// console.log(rrr,'=======rrr')
							}

						}


						if (mainResultD.useMergeCon) {
							try {
								const tmpObj = JSON.parse(unescape(item.resultDesc))
								if (!tmpObj.noConclusion && tmpObj.conclusion) {
									console.log('tmpObj - data：', tmpObj)
									console.log(conclusion, '----conclusion')
									conclusion = conclusion ? conclusion + '，' + tmpObj.conclusion : tmpObj
										.conclusion
								}
							} catch (e) {
								console.log('解析失败：', e);
							}
						}



						if (mainResultD.hasRadarGraph || mainResultD.useSubCompContent) {
							myRadarDataStrArr.push(item.dmnsName)
							myRadarDataScoreArr.push(item.score)

							if (mainResultD.hasCommonModelRadarData) {
								console.log(item.dmnsName, '-----------item.dmnsName')
								if (item.dmnsName) {
									console.log(mainResultD.commonModelRadarData,
										'=========mainResultD.commonModelRadarData')
									const currentHeathNum = mainResultD.commonModelRadarData.find(node => item
										.dmnsName === node
										.key).data
									commonModelData.push(currentHeathNum)
								}

							}

							console.log('--mainResultD.hasRadarGraph--', detailedResults)

							try {
								const parseObj = JSON.parse(unescape(item.resultDesc))
								console.log(parseObj, '================parseObj')
								const tmpResultContentArr = parseObj.contentArr
								if (!detailedResults.contentArr) {
									detailedResults.contentArr = []
								}
								console.log(tmpResultContentArr, '========================tmpResultContentArr')

								detailedResults.contentArr.push({
									tit: item.dmnsName,
									contentArr: tmpResultContentArr,
									hasLine: true
								})
							} catch (e) {

							}
						}

						if (mainResultD.scoreInfoType == '1') {
							if (index === 0 && (mainResultD.useFirstResultConclusion || mainResultD
									.useCustomAlgorithmResults)) {
								return {
									label: "总分",
									score: item.score,
									str: item.resultTitle,
								}

							} else {
								return {
									label: item.dmnsName,
									score: item.score,
									str: item.resultTitle,
								}
							}

						} else if (mainResultD.scoreInfoType == '2') {
							const healthScore = JSON.parse(unescape(item.resultDesc)).healthScore
							return {
								score: item.score,
								healthScore
							}
						} else if (mainResultD.scoreInfoType == '3') {
							if (index === 0 && (mainResultD.useFirstResultConclusion || mainResultD
									.useCustomAlgorithmResults)) {
								return {
									label: '总分',
									str: item.score
								}
							} else {
								return {
									label: item.dmnsName,
									str: item.score
								}
							}
						} else if (mainResultD.scoreInfoType == '4') {
							console.log(item.resultDesc, '======item.resultDesc')
							const tmpObj = JSON.parse(unescape(item.resultDesc))
							if (index === 0 && mainResultD.useFirstResultConclusion) {
								detailedResults = tmpObj.detailedResults || {}
								detailedResults.contentArr = [] //清空
								return {
									label: '总分',
									score: item.score,
									conclusion: tmpObj.shortConclusion,
									healthScore: tmpObj.healthScore
								}

							} else {
								console.log(detailedResults, '====detailedResults')
								detailedResults.contentArr.push(
									tmpObj.detailedResults
								)
								return {
									label: item.dmnsName,
									score: item.score,
									conclusion: tmpObj.shortConclusion,
									healthScore: tmpObj.healthScore
								}

							}


							// const parseObj = JSON.parse(unescape(item.resultDesc))

						}
					})
				}


				//雷达图信息
				let radarData = null
				if (mainResultD.hasRadarGraph) {
					if (!myRadarDataStrArr[0]) {
						//去除总分的雷达信息
						myRadarDataStrArr.shift()
						myRadarDataScoreArr.shift()
					}
					console.log(myRadarDataStrArr, '-------myRadarDataStrArr')
					radarData = {
						"categories": myRadarDataStrArr,
						"series": [{
							"name": "数据",
							"color": "#FEB069",
							"data": myRadarDataScoreArr,
							"index": 0,
							"pointShape": "square",
							"show": true,
							"labelShow": false,
							"textColor": "rgba(0,0,0,1)",
							"type": "radar"
						}],
						"legend": {
							"show": false
						},
					}

					if (mainResultD.hasCommonModelRadarData) {
						radarData.series[0].color = "#6B77FF"
						radarData.series.push({
							"name": "常模",
							"color": "#FEB069",
							"data": commonModelData,
							"index": 0,
							"pointShape": "square",
							"show": true,
							"labelShow": false,
							"textColor": "rgba(0,0,0,1)",
							"type": "radar"
						})

					}
				}
				console.log(suggestions, '===suggestions')
				dData.createDate = Number(dData.createDate)

				console.log(mainImg, '-------mainImg')

				if (tmpPushResultArr && tmpPushResultArr.length > 0) {
					detailedResults.contentArr = [...detailedResults.contentArr, ...tmpPushResultArr]

					console.log(detailedResults.contentArr, '=============detailedResults.contentArr')
				}
				console.log(mainResultD,
					'===============================mainResultDmainResultDmainResultDmainResultDmainResultD')
				console.log(detailedResults, '=======detailedResults')
				if (dData.detailInfo && dData.detailInfo.isSclAllReport) {
					this.isSclAllReport = dData.detailInfo && dData.detailInfo.isSclAllReport
				}
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					firstScore: dData.resultList && dData.resultList[0] && dData.resultList[0].score,
					radarData,
					dimensionsType: mainResultD.dimensionsType,
					scoreInfoType: mainResultD.scoreInfoType,
					hasRadarGraph: mainResultD.hasRadarGraph,
					literatrue: mainResultD.literatrue,
					sciencePopularization: mainResultD.sciencePopularization || tmpSciencePopularization,
					detailedResults,
					conclusion,
					subConclusion,
					suggestions,
					radarMax: mainResultD.radarMax,
					imgAndScoreBlockType: mainResultD.imgAndScoreBlockType,
					otherTipText: mainResultD.otherTipText,
					otherTipImg: mainResultD.otherTipImg,
					mainImg,
					normComparison,
					qsnMax: mainResultD.qsnMax,
					rightQsn: totalScore,
					scoreInfoRightStr: mainResultD.scoreInfoRightStr,
					detailInfo: dData.detailInfo
				}


				console.log(this.pageDataCommon, '====this.pageDataCommon')
			},
			/**
			 * 显示咨询企业微信活码
			 */
			showQrCode() {
				this.showQrCodeFlag = true;
			},
			closeHandle() {
				this.$store.dispatch('user/getUserDiscountTakeEffect')
				this.$store.dispatch('user/getUserDiscountInfo')
				this.couponModalVisible = false
				this.showCanvas = true
				this.initCanvas(this.detail);
			},
			hide() {
				this.showQrCodeFlag = false
				this.initCanvas(this.detail);
			},

			async getSclInfo(sclId) {
				const res = await get_scl_info({
					sclId: sclId
				})
				const {
					data: dRes
				} = res
				const {
					detailInfo = '', scloReportDetail = ''
				} = dRes.data
				let fullTypeShareImg = ''
				let tmpObj = {}
				this.collectNums = dRes.data.collectNums;
				if (detailInfo) {
					tmpObj = JSON.parse(detailInfo)
					if (tmpObj.resultPage) {
						if (tmpObj.resultPage == "eq-and-iq") {
							uni.redirectTo({
								url: `/subcontractorB/pages/sclMultipackResultEqAndIq/sclMultipackResultEqAndIq?reportId=${this.reportId}&sclId=${sclId}&fromHistory=${this.fromHistory}`
							})
						} else {
							uni.redirectTo({
								url: `/subcontractorB/pages/sclMultipackResult/sclMultipackResult?reportId=${this.reportId}&sclId=${sclId}&fromHistory=${this.fromHistory}`
							})
						}

						return {
							_res: false
						}
					}

					this.isScl90 = tmpObj.sclType == 'scl90'
					if (tmpObj.introType == 'full') {
						fullTypeShareImg = tmpObj.fullShareImg
						this.moreType = tmpObj.moreType
					}
					if (tmpObj.fullType) {
						this.fullType = tmpObj.fullType
					}
					if (tmpObj.moreScl) {
						this.isShowMoreBtn = tmpObj.moreScl == 'Y'
					}

					if (tmpObj.hasOwnProperty('checkUpShowAdsFlag')) {
						this.checkUpShowAdsFlag = tmpObj.checkUpShowAdsFlag
					}

					if (tmpObj.hasOwnProperty('showAdsWrapper_2')) {
						this.showAdsWrapper2 = tmpObj.showAdsWrapper_2
					}
					if (tmpObj.hasOwnProperty('showAdsWrapper_1')) {
						this.showAdsWrapper1 = tmpObj.showAdsWrapper_1
					}
					if (tmpObj.hasOwnProperty('showAdsWrapper_3')) {
						this.showAdsWrapper3 = tmpObj.showAdsWrapper_3
					}
					if (tmpObj.hasOwnProperty('showAdsWrapper_4')) {
						this.showAdsWrapper4 = tmpObj.showAdsWrapper_4
					}

					if (!this.checkUpShowAdsFlag && this.sclReportType == 1) {
						this.showAdsWrapper1 = this.showAdsWrapper2 = this.showAdsWrapper3 = false
					}

					this.checkMoreBtn = tmpObj.checkMoreBtn
				}
				if (scloReportDetail) {
					this.sclReportDetail = scloReportDetail

					try {
						const otherInfoObj = JSON.parse(scloReportDetail) || {}
						if (otherInfoObj.buyNextSclId) {
							this.nextId = otherInfoObj.buyNextSclId
						}

						if (otherInfoObj.hasOwnProperty('showAdsWrapper_2')) {
							this.showAdsWrapper2 = otherInfoObj.showAdsWrapper_2
						}
						if (otherInfoObj.hasOwnProperty('showAdsWrapper_1')) {
							this.showAdsWrapper1 = otherInfoObj.showAdsWrapper_1
						}
					} catch (e) {
						console.log(e, '---------e')
					}

				}
				this.shareData.title = dRes.data.sclName;
				this.shareData.path = '/pages/index/index?userType=sclShare&sclId=' + dRes.data.id + '&inviteId=' +
					this
					.clientUserUid + '&adType=' + (dRes.data.adType ? dRes.data.adType : '') + '&code=' + (dRes.data
						.discountCode ? dRes.data.discountCode : '');
				this.shareData.imageUrl = tmpObj.shareImg || fullTypeShareImg || dRes.data.detailImg;

				// this.isShowRecommend = dRes.data.newOriginalPrice > 0 //&& dRes.data.discountPrice > 0

				return {
					isSpecial: dRes.data.isSpecial,
					scloReportDetail: dRes.data.scloReportDetail,
					_res: true,
					repurchaseSwitch: dRes.data.repurchaseSwitch,
					detailInfo: tmpObj
				}
			},
			async getResult(id) {
				let dRes = {}
				if (this.sclReportType == 2 || this.sclReportType == 3) {
					const tmpRes = await this.$u.api.getExaminationResultShow({
						sclExaminationReprotId: id
					})
					console.log(tmpRes, '=====tmpRes')

					dRes = tmpRes.data.data
				} else if (this.sclReportType == 1 && this.actGroup != 'base' && this.addSclWay != '1') {
					let tmpRes = await this.$u.api.getCheckUpSclDetail({
						sclExaminationReprotId: id,
					})

					dRes = tmpRes.data
					dRes = dRes.data.sclReportResultShow
					if (!dRes) {
						tmpRes = await resultShow({
							reportId: id,
						})
						dRes = tmpRes.data
					}
				} else {
					const tmpRes = await resultShow({
						reportId: id,
					})
					dRes = tmpRes.data
				}

				console.log(dRes, '=====tmpRes-2')
				if (dRes.code == 2000) {
					const dData = dRes.data
					const result = dData.resultList[0]
					const {
						sclId
					} = dRes.data
					// const {
					// 	data: fRes
					// } = await isEshopScl({
					// 	sclId
					// })
					this.eshopDiscountList = dData.eshopDiscountList
					this.sclId = sclId


					const {
						isSpecial,
						scloReportDetail,
						_res,
						repurchaseSwitch,
						detailInfo
					} = await this.getSclInfo(sclId) || {}
					if (!_res) {
						return false
					}
					dData['scloReportDetail'] = scloReportDetail
					dData['detailInfo'] = detailInfo
					if (dData.specialType == 'beike') {
						console.log('dData.reportPageType')
						this.processResultDataToRenderDataPageA(dData)
						this.pageComp = 'pageA'
					} else if (dData.specialType == 'scl90') {
						console.log('report - scl90')
						this.processResultDataToRenderDataPageSCL90(dData)
						this.pageComp = 'pageSCL90'
					} else if (dData.specialType == 'mbti') {
						console.log('report - mbti')
						this.processResultDataToRenderDataPageMBTI(dData)
						this.pageComp = 'pageMBTI'
					} else if (dData.scloReportDetail && dData.scloReportDetail.includes('dongwulianai')) {
						console.log('report - dongwulianai')
						this.processResultDataToDongWuLian(dData)
						this.pageComp = 'dongwulianai'
					} else if (isSpecial === 'Y') {
						console.log(dData, '======dData')
						console.log('这是特殊测评 dddd')
						await this.processResultDataToRenderDataPageCommonSpecial(dData)

						console.log(this.pageComp, '===this.pageComp')
					} else {
						this.pageComp = 'normal'
						this.addSclWay = dData.addSclWay
						this.detail = dRes.data
						this.detail.createDate = this.$dayjs(parseInt(dData.createDate)).format("YYYY-MM-DD HH:mm")

						if (result && result.score != "" && result.score != null) {
							this.score = result.score
							this.isScore = true
						} else {
							this.isScore = false
						}

						this.initCanvas(dData);
						this.setMap = this.processResultDataToRenderData(dData);

						this.renderResultData = this.addSclWay == '1' ? [this.setMap[0]] : this.setMap

						let isNeedSetSize = false
						if (this.renderResultData && this.renderResultData[this.renderResultData.length - 1] && this
							.renderResultData[this.renderResultData.length - 1].resultTitle === '【other】') {
							console.log(dData.scloReportDetail, '------dData.scloReportDetail')
							const tmpInfo = this.renderResultData.pop()
							this.fanhuaData = JSON.parse(unescape(tmpInfo.resultDesc))
							this.showFullFloatImg = true
							isNeedSetSize = true
						} else if (this.fullType == 'x02' || this.fullType == 'x03' || this.fullType == 'x06') {
							const tmpInfo = JSON.parse(this.sclReportDetail)
							if (tmpInfo.resultOpts) {
								const tmpFloatInfo = tmpInfo.resultOpts.find((item) => {
									return item.key == this.renderResultData[0].resultTitle
								})
								isNeedSetSize = true

								if (tmpFloatInfo) {
									if (this.fullType == 'x02') {
										const tmpReusltImg = await this.createChipCanvas(tmpFloatInfo.val.resultImg, {
											y: 1100
										})
										this.fanhuaData = {
											flotImg: tmpFloatInfo.val.floatImg,
											resultImg: tmpReusltImg,
										}
									} else if (this.fullType == 'x06') {
										const tmpReusltImg = await this.createChipCanvas(tmpFloatInfo.val.resultImg, {
											y: 1000
										}, 'p=2@id=' + this.sclId)
										isNeedSetSize = false
										this.fanhuaData = {
											flotImg: tmpFloatInfo.val.floatImg,
											resultImg: tmpReusltImg,
											floatW: '136rpx',
											floatH: '194rpx'
										}
									} else {
										this.fanhuaData = {
											flotImg: tmpFloatInfo.val.floatImg,
											resultImg: tmpFloatInfo.val.resultImg,
										}
									}

									this.showFullFloatImg = true
								}
							}

						} else if (this.fullType == 'x04') {
							const tmpInfo = JSON.parse(unescape(this.renderResultData[0].resultDesc))

							this.renderResultData[0].resultDesc = ''
							this.isScore = false
							const tmpReusltImg = await this.createChipCanvas(tmpInfo.resultImg)
							this.fanhuaData = {
								flotImg: tmpInfo.flotImg,
								resultImg: tmpReusltImg,
								floatW: tmpInfo.floatImgPosition.width,
								floatH: tmpInfo.floatImgPosition.height,
								closeBtnImg: tmpInfo.closeResult.img,
								cBtnWidth: tmpInfo.closeResult.width,
								cBtnHeight: tmpInfo.closeResult.height,
							}
							this.showFullFloatImg = true

						}

						if (isNeedSetSize) {
							this.fanhuaData.floatW = '178rpx'
							this.fanhuaData.floatH = '70rpx'
							if (this.fullType == 'x03') {
								this.fanhuaData.floatW = '148rpx'
								this.fanhuaData.floatH = '128rpx'
							}
						}
					}
					this.repurchaseSwitch = repurchaseSwitch
				} else {
					this.$showToast("获取测评结果失败" + dRes.message)
				}
			},
			async createChipCanvas(imgUrl, coords, jumpUrl) {
				console.log(imgUrl, '------------imgUrl')
				uni.showLoading({
					title: '生成中...',
					mask: true
				})

				const tmpScene = jumpUrl || 'r=5@id=' + this.clientUserUid
				const tmpPage = 'pages/index/index'
				let qrCode = this.defaultQrcode
				let imgD = ''
				const resSclInfo = await this.$u.api.getSclInfo({
					sclId: this.sclId
				})
				if (resSclInfo.data.data.url) {
					qrCode = resSclInfo.data.data.url
				} else {
					const {
						data: dRes
					} = await this.$u.api.getQrcodeUrl({
						sceneStr: tmpScene,
						pageStr: tmpPage
					})

					if (dRes.success) {
						qrCode = dRes.data
					}
				}
				console.log(qrCode, '----------qrCode')

				try {
					// 创建绘制工具
					const dp = await useDrawPoster({
						selector: 'dcanvas',
						loading: true,
						debug: true,
						width: 750,
						height: 1624
					})
					const w = dp.canvas.width
					const h = dp.canvas.height

					console.log(dp.canvas, '-----------dp.canvas-------')

					dp.draw(async (ctx) => {
						// 绘制背景图
						await ctx.drawImage(imgUrl, 0, 0, w, h)

						console.log(ctx, '---------ctx-----')
						let qrCodeTmpCoords = {
							y: coords ? coords.y : 1200,
							x: coords ? coords.x : 558
						}

						// 小程序二维码
						await ctx.drawRoundImage(qrCode, qrCodeTmpCoords.x, qrCodeTmpCoords.y, 138, 138,
							100)

					})

					imgD = await dp.create()
				} catch (e) {

				}
				console.log(imgD, '=========imgD')
				uni.hideLoading()
				return imgD || imgUrl
			},
			processResultDataToRenderDataPagePPCS(dData) {
				const result = dData.resultList[0]
				const resultDetails = JSON.parse(unescape(result.resultDesc))
				this.pageComp = 'pagePPCS'

				resultDetails.scoreArr[0].healthScore = unescape(resultDetails.scoreArr[0].healthScore)
				//最终结论
				const conclusionStr = resultDetails.conclusionStr

				//健康指标最高分数
				const maxHealthScore = resultDetails.scoreArr[0].healthScore.match(/\d+/g).join('')

				resultDetails.scoreArr[0].str = parseInt(result.score) < parseInt(maxHealthScore) ? "较低" : "较高"

				//维度信息
				const tmpScoreArr = resultDetails.scoreArr.map(item => {
					return {
						label: item.label,
						score: parseInt(result.score),
						str: item.str || '',
						commonInfo: unescape(item.healthScore)
					}
				})

				let maxIndex = 0
				let prevNum = 0
				const tmpStrArr = ['引发内疚感', '收回关爱', '坚持权威']
				const tmpSectionScoreArr = []
				const myRadarDataStrArr = []
				const myRadarDataScoreArr = []
				dData.resultSetMap.map(item => {
					myRadarDataStrArr.push(item.dmnsName)
					myRadarDataScoreArr.push(item.myScore)
					item.myScore = parseInt(item.myScore)
					if (item.myScore > prevNum) {
						console.log(item.myScore)
						maxIndex = tmpStrArr.indexOf(item.dmnsName)
						prevNum = item.myScore
					}
					const tmpIndex = tmpStrArr.indexOf(item.dmnsName)
					tmpSectionScoreArr[tmpIndex] = item.myScore
					console.log(item.myScore, '===item.myScore')
					console.log(tmpIndex, '=====tmpIndex')
					tmpScoreArr.push({
						label: item.dmnsName,
						score: item.myScore,
						str: '',
						commonInfo: ''
					})
				})

				resultDetails.detailedResults.p = resultDetails.detailedResults.p.replace(/XX/g, tmpScoreArr[0].score)

				function replaceXX(match, index, replacements) {
					if (replacements) {
						const tmp = replacements.shift()
						return tmp
					} else {
						return match; // 保留其他情况下的匹配项
					}
				}
				resultDetails.detailedResults.subP = resultDetails.detailedResults.optionsArr[maxIndex]
				// resultDetails.detailedResults.optionsArr 排列顺序，1.引发内疚感,2.撤回关爱,3.限制表达
				if (maxIndex == 0) {
					const replacements = [tmpSectionScoreArr[0], tmpSectionScoreArr[1], tmpSectionScoreArr[2]]
					console.log(replacements, '===replacements')
					resultDetails.detailedResults.subP = resultDetails.detailedResults.subP.replace(/XX/g, (match,
							index) =>
						replaceXX(match, index, replacements));
				} else if (maxIndex == 1) {
					const replacements = [tmpSectionScoreArr[1], tmpSectionScoreArr[0], tmpSectionScoreArr[2]]
					resultDetails.detailedResults.subP = resultDetails.detailedResults.subP.replace(/XX/g, (match,
							index) =>
						replaceXX(match, index, replacements));
				} else if (maxIndex == 2) {
					const replacements = [tmpSectionScoreArr[2], tmpSectionScoreArr[0], tmpSectionScoreArr[1]]
					resultDetails.detailedResults.subP = resultDetails.detailedResults.subP.replace(/XX/g, (match,
							index) =>
						replaceXX(match, index, replacements));
				}

				console.log(maxIndex, '====maxINdex')
				console.log(resultDetails.detailedResults.subP, '====resultDetails.detailedResults.subP')

				//常模信息
				const commonModel = resultDetails.normComparison

				resultDetails.sciencePopularization.contentArr.map(item => {
					item.p = unescape(item.p)
				})

				const radarData = {
					"categories": myRadarDataStrArr,
					"series": [{
						"name": "数据",
						"color": "#FEB069", // 1.引发内疚感,2.撤回关爱,3.限制表达
						"data": myRadarDataScoreArr,
						"index": 0,
						"pointShape": "square",
						"show": true,
						"labelShow": false,
						"type": "radar"
					}]
				}

				dData.createDate = Number(dData.createDate)

				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					normComparison: commonModel,
					detailedResults: resultDetails.detailedResults,
					sciencePopularization: resultDetails.sciencePopularization,
					suggestions: resultDetails.suggestions,
					literatrue: resultDetails.reference,
					radarData: radarData
				}
			},
			processResultDataToRenderDataPageOLSON(dData) {
				const result = dData.resultList[0]
				const mainResultD = JSON.parse(dData.scloReportDetail) || {}
				this.pageComp = 'pageOLSON'

				const resultDetails = JSON.parse(unescape(result.resultDesc))
				resultDetails.scoreArr[0].healthScore = unescape(resultDetails.scoreArr[0].healthScore)
				//最终结论
				const conclusionStr = resultDetails.conclusionStr
				const myRadarDataStrArr = []
				const myRadarDataScoreArr = []

				//维度信息
				const categoriesArr = []
				const commonModelData = []
				const myModelData = []
				const commonModelInfo = resultDetails.scoreArr
				const tmpScoreArr = dData.resultSetMap.map((item, index) => {
					myRadarDataStrArr.push(item.dmnsName)
					myRadarDataScoreArr.push(item.myScore)
					console.log(item, '=====map - resultSetMap - item')
					let tmpDD = commonModelInfo.find(node => item.dmnsName === node.label)
					console.log(tmpDD, '=====map = tmpDD')
					const currentHeathNum = commonModelInfo.find(node => item.dmnsName === node.label).healthIndex
					categoriesArr.push(item.dmnsName)
					commonModelData.push(Number(currentHeathNum.replace(/[^\d]/g, " ")))
					myModelData.push(Number(item.myScore))

					return {
						label: item.dmnsName,
						score: parseInt(item.myScore),
						commonInfo: currentHeathNum
					}
				})
				tmpScoreArr.unshift({
					label: "总分",
					score: result.score,
					str: resultDetails.shortConclusion, //item.myIndex,
					commonInfo: resultDetails.healthNum
				})

				console.log(tmpScoreArr, '======tmpScoreArr')
				console.log(categoriesArr, '====categoriesArr')
				console.log(commonModelData, '====commonModelData')
				console.log(myModelData, '====myModelData')
				console.log(commonModelInfo, '-=====commonModelInfo')

				//常模信息
				const commonModel = resultDetails.normComparison

				resultDetails.sciencePopularization.contentArr.map(item => {
					item.p = unescape(item.p)
				})

				const tmpRadarData = {
					"categories": categoriesArr,
					"series": [{
							"name": "常模",
							"color": "#FEB069",
							"data": commonModelData,
							"index": 0,
							"pointShape": "square",
							// "labelText":'190,210,105,35,27,102,190,210,105',
							"show": true,
							"labelShow": false,
							"textColor": "rgba(0,0,0,0)",
							"type": "radar"
						},
						{
							"name": "雷达图",
							"color": "#6B77FF",
							"data": myModelData,
							"index": 0,
							"pointShape": "square",
							"show": true,
							"type": "radar",
							"labelShow": true,
							// show:true
						},
					]
				}

				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					radarData: tmpRadarData,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					normComparison: commonModel,
					detailedResults: resultDetails.detailedResults,
					sciencePopularization: resultDetails.sciencePopularization,
					suggestions: resultDetails.suggestions,
					literatrue: resultDetails.reference,
					showProgressComp: resultDetails.showProgressComp,
				}
			},
			processResultDataToRenderData3TO1(dData) {
				this.pageComp = 'normal'
				const result = dData.resultList[0]
				this.addSclWay = dData.addSclWay
				this.detail = dData
				this.detail.createDate = this.$dayjs(parseInt(dData.createDate)).format("YYYY-MM-DD HH:mm")
				this.resultSetMap = dData.resultSetMap
				if (result.score != "" && result.score != null) {
					this.score = result.score
					this.isScore = true
				} else {
					this.isScore = false
				}

				// this.initCanvas(dData);

				// const result = dData.resultList[0]
				const returnArr = []



				this.isScore = false
				dData.resultList.forEach((item, i) => {

					if (i === 0) {
						this.scl3To1FristTit = item.dmnsName
						var obj = {};
						//结果内容
						var modelCont = item.modelDescList[0].modelDesc
						//概况图片
						if (item.resultPic) {
							obj.resultPic = item.resultPic
							obj.isResultPic = true
						} else {
							obj.isResultPic = false
						}


						//维度得分
						if (item.score && item.score != "" && item.score != null && dData.resultShow == "2") {
							obj.score = item.score;

							this.isCanvasBox = true
							let score = parseInt(obj.score);
							let showYiBiaoData = {
								categories: [{
									"value": 0.2,
									"color": "#30b26a"
								}, {
									"value": 0.8,
									"color": "#eab438"
								}, {
									"value": 1,
									"color": "#ff4500"
								}],
								series: [{
									name: "完成率",
									data: (score / 100).toFixed(2)
								}]
							};
							this.showYiBiao('canvasPie', showYiBiaoData, score)

						}
						//结果标题
						if (item.resultTitle != "" && item.resultTitle != null) {
							obj.resultTitle = item.resultTitle;
						}
						obj.resultDesc = this.initRichText(modelCont);
						returnArr.push(obj)
					} else if (i === 1) {
						var obj = {};
						//结果内容
						var modelCont = item.resultDesc
						//概况图片
						if (item.resultPic) {
							obj.resultPic = item.resultPic
							obj.isResultPic = true
						} else {
							obj.isResultPic = false
						}

						//维度得分
						if (item.score && item.score != "" && item.score != null && dData.resultShow == "2") {
							obj.score = item.score;

							this.isCanvasBox = true
							let score = parseInt(obj.score);
							let showYiBiaoData = {
								categories: [{
									"value": 0.2,
									"color": "#30b26a"
								}, {
									"value": 0.8,
									"color": "#eab438"
								}, {
									"value": 1,
									"color": "#ff4500"
								}],
								series: [{
									name: "完成率",
									data: (score / 100).toFixed(2)
								}]
							};
							this.$nextTick(() => {
								this.showYiBiao('canvasPie0', showYiBiaoData, score)
							})
						}

						console.log(`${i} is ok`)

						item.modelDescList.forEach((dim, j) => {
							console.log(dim.modelDesc, '====modelDesc')
							if (unescape(dim.modelDesc) != '') {
								console.log(obj, '=====obj')
								returnArr.push({
									resultDesc: this.initRichText(dim.modelDesc)
								})
							}

						})
						console.log(`${i} is end`)



						// returnArr.push(obj)
					} else if (i === 2) {
						var obj = {};
						//结果内容
						var modelCont = item.resultDesc
						//概况图片
						if (item.resultPic) {
							obj.resultPic = item.resultPic
							obj.isResultPic = true
						} else {
							obj.isResultPic = false
						}

						//维度得分
						if (item.score && item.score != "" && item.score != null && dData.resultShow == "2") {
							obj.score = item.score;

							this.isCanvasBox = true
							let score = parseInt(obj.score);
							let showYiBiaoData = {
								categories: [{
									"value": 0.2,
									"color": "#30b26a"
								}, {
									"value": 0.8,
									"color": "#eab438"
								}, {
									"value": 1,
									"color": "#ff4500"
								}],
								series: [{
									name: "完成率",
									data: (score / 100).toFixed(2)
								}]
							};
							this.$nextTick(() => {
								this.showYiBiao('canvasPie1', showYiBiaoData, score)
							})
							returnArr.push(obj)
						}

						item.modelDescList.forEach((dim, j) => {
							let obj = {}
							console.log(dim.modelDesc, '====modelDesc')
							if (unescape(dim.modelDesc) != '') {
								// obj.resultDesc = this.initRichText(dim.modelDesc)
								console.log(obj, '=====obj')
								returnArr.push({
									resultTitle: dim.resultTitle,
									resultDesc: this.initRichText(dim.modelDesc)
								})
								returnArr.push(obj)
							}
						})

					}

					if (i < 2) {
						returnArr.push({
							createCanvas: true,
							index: i,
							nextTit: dData.resultList[i + 1]?.dmnsName
						})
					}

				})

				console.log(returnArr, '======returnArr setMap')

				this.setMap = returnArr
				this.renderResultData = this.addSclWay == '1' ? [this.setMap[0]] : this.setMap


				console.log(this.renderResultData)

			},
			processResultDataToRenderDataCRYL(dData) {
				const result = dData.resultList[0]
				const resultDetails = JSON.parse(unescape(result.resultDesc))
				this.pageComp = 'pageCRYL'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				console.log(resultDetails, '-----result------')

				let categoryDepression = {}
				let categoryMania = {}
				let flagDepression = false
				let flagMania = false
				let conculsionIndex = 0

				const tmpScoreArr = []
				const detailedResults = {
					tit: '',
					p: '',
					contentArr: []
				}

				dData.resultList.splice(1, dData.resultList.length).map(item => {
					const tmpObj = resultDetails.scoreArr.find((node) => node.label === item.dmnsName)
					if (item.dmnsName == '回避维度') {
						flagDepression = parseInt(tmpObj.healthIndex) <= parseInt(item.score)
					} else if (item.dmnsName == '焦虑维度') {
						flagMania = parseInt(tmpObj.healthIndex) <= parseInt(item.score)
					}

					tmpScoreArr.push({
						label: item.dmnsName,
						// score:item.myScore,
						score: item.score,
						str: item.resultTitle,
						commonInfo: `<${tmpObj.healthIndex}`
					})

					detailedResults.contentArr.push(({
						tit: item.resultTitle,
						p: item.resultDesc
					}))
				})

				if (flagDepression && flagMania) {
					conculsionIndex = 3
				} else if (flagDepression && !flagMania) {
					conculsionIndex = 1
				} else if (!flagDepression && flagMania) {
					conculsionIndex = 2
				} else {
					conculsionIndex = 0
				}


				const mainResult = resultDetails.mainResult[conculsionIndex]

				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					detailedResults: mainResult,
					literatrue: resultDetails.reference,
					moreData: resultDetails
				}

				console.log(this.pageDataCommon, '-----this.pageDataCommon----')
				console.log(dData, '-----this.pageDataCommon----')

			},
			processResultDataToRenderDataBD(dData) {
				const result = dData.resultList[0]
				const resultDetails = JSON.parse(unescape(result.resultDesc))
				this.pageComp = 'pageBD'

				let categoryDepression = {}
				let categoryMania = {}
				let flagDepression = false
				let flagMania = false
				let conculsionIndex = 0

				const tmpScoreArr = []
				const detailedResults = {
					tit: '',
					p: '',
					contentArr: []
				}
				dData.resultList.splice(1, dData.resultList.length).map(item => {
					const tmpObj = resultDetails.scoreArr.find((node) => node.label === item.dmnsName)
					if (item.dmnsName == '抑郁程度') {
						flagDepression = parseInt(tmpObj.healthIndex) <= parseInt(item.score)
					} else if (item.dmnsName == '躁狂程度') {
						flagMania = parseInt(tmpObj.healthIndex) <= parseInt(item.score)
					}

					tmpScoreArr.push({
						label: item.dmnsName,
						// score:item.myScore,
						score: item.score,
						str: item.resultTitle,
						commonInfo: `<${tmpObj.healthIndex}`
					})

					detailedResults.contentArr.push(({
						tit: item.resultTitle,
						p: item.resultDesc
					}))
				})
				// resultDetails.scoreArr

				// console.log(detailedResults,'====detailedResults')
				// console.log(flagDepression,'====flagDepression')
				// console.log(flagMania,'===flagMania')

				if (flagDepression && flagMania) {
					conculsionIndex = 1
				} else if (flagDepression && !flagMania) {
					conculsionIndex = 2
				} else if (!flagDepression && flagMania) {
					conculsionIndex = 3
				} else {
					conculsionIndex = 0
				}

				const conclusionStr = resultDetails.conculsionArr[conculsionIndex]

				const commonModel = resultDetails.normComparison

				commonModel['url'] = conculsionIndex === 0 ? commonModel.goodUrl : commonModel.badUrl

				dData.createDate = Number(dData.createDate)
				if (dData.detailInfo && dData.detailInfo.isSclAllReport) {
					this.isSclAllReport = dData.detailInfo && dData.detailInfo.isSclAllReport
				}
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					normComparison: commonModel,
					detailedResults: detailedResults,
					sciencePopularization: resultDetails.sciencePopularization,
					suggestions: resultDetails.suggestions,
					literatrue: resultDetails.reference,
					scoreArr: tmpScoreArr,
					detailInfo: dData.detailInfo
				}
			},
			processResultDataToRenderDataYIYU(dData) {
				this.pageComp = 'pageCommon'

				// const result = dData.resultList[0]
				const mainResultD = JSON.parse(dData.scloReportDetail) || {}
				console.log(dData, '=====dData======processResultDataToRenderDataYIYU')


				const rightNum = dData.resultList.filter((item) => {
					return item.resultTitle.includes("正确");
				}).length
				const accuracy = (rightNum / dData.resultList.length) * 100;

				//最终结论
				const conclusionStr = `您总共答对${rightNum}道题，准确率${accuracy.toFixed(0)}%`



				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					sciencePopularization: mainResultD.knowledge,
					suggestions: mainResultD.suggestions,
					literatrue: mainResultD.literatrue,
					showProgressComp: false
				}


			},
			processResultDataToRenderDataQX(dData) {
				this.pageComp = 'pageQX'

				console.log(dData.resultList, '----dData.resultList')
				console.log(dData, '----dData')
				const sclReportJson = JSON.parse(dData.sclReportJson)
				const tmpObj = JSON.parse(unescape(dData.resultList[0].resultDesc))
				console.log(tmpObj, '---tmpObj-')

				// dData.resultList[0]

				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					img: tmpObj.img,
					img2: tmpObj.img2,
					num: dData.resultList[0].score,
					optnList: sclReportJson[0]
				}
			},
			async processResultDataToRenderDataYY3TO1(dData, mainResultD) {
				this.pageComp = 'pageYY3TO1'
				//维度信息
				let tmpScoreArr = []

				//最终结论
				let conclusionArr = []

				let subConclusion = ''

				//常模数据
				let commonModelData = []

				//常模对象
				let normComparison = null

				//建议
				let suggestions = null

				let totalScore = 0

				let sciencePopularization = mainResultD.sciencePopularization

				//结果详解
				let detailedResults = {
					contentArr: []
				}

				let mainImg = ''

				let tmpPushResultArr = []

				let progressNum = 0

				console.log(mainResultD, '=====mainResultD====1111')

				tmpScoreArr = dData.resultList.map((item, index) => {

					const tmpObj = JSON.parse(unescape(item.resultDesc))
					console.log(tmpObj, '===item.tmpObj')

					const {
						showProgressComp
					} = tmpObj

					try {
						if (!tmpObj.noConclusion && tmpObj.conclusion) {
							conclusionArr.push(tmpObj.conclusion)
						}
					} catch (e) {
						console.log('解析失败：', e);
					}

					let tmpSciencePopularization = tmpObj.sciencePopularization

					// let detailedResults = tmpObj.detailedResults || {}

					let tmpSuggestions
					try {
						tmpSuggestions = tmpObj.suggestions ? JSON.parse(tmpObj.suggestions) : null
					} catch (e) {
						tmpSuggestions = this.$lodash.isObject(tmpObj.suggestions) ? tmpObj.suggestions : null
					}
					tmpSuggestions = this.$lodash.isEmpty(tmpSuggestions) ? null : tmpSuggestions

					if (showProgressComp) {
						detailedResults.showProgressComp = showProgressComp
						progressNum = item.score
					}
					if (tmpObj.normComparison) {
						normComparison = tmpObj.normComparison
					}

					if (tmpSciencePopularization) {
						sciencePopularization.contentArr.push({
							tit: '',
							contentArr: tmpSciencePopularization.contentArr
						})
					}

					if (tmpObj.contentArr) {
						tmpPushResultArr.push({
							tit: item.dmnsName,
							contentArr: tmpObj.contentArr
						})
					}

					console.log(item.dmnsName + '-sug：', tmpSuggestions)
					console.log(item.dmnsName + '-kepu：', tmpSciencePopularization)
					if (tmpSuggestions) {
						suggestions = tmpSuggestions
					}

					return {
						label: item.dmnsName,
						str: item.score
					}
				})

				tmpScoreArr.unshift({
					label: "总分",
					str: tmpScoreArr.reduce((accumulator, currentValue) => accumulator + currentValue.str,
						0) // 修正了这里
				});

				console.log(suggestions, '===suggestions')

				if (tmpPushResultArr && tmpPushResultArr.length > 0) {
					detailedResults.contentArr = [...detailedResults.contentArr, ...tmpPushResultArr]

					console.log(detailedResults.contentArr, '=============detailedResults.contentArr')
				}

				const filteredStrings = conclusionArr.filter(str =>
					str.includes("安全感") || str.includes("控制感")
				);
				conclusionArr = conclusionArr.filter(str => !str.includes("安全感") && !str.includes("控制感"))
				const combinedString = filteredStrings.join(", ");
				conclusionArr.push(combinedString)

				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					scoreInfoType: mainResultD.scoreInfoType,
					literatrue: mainResultD.literatrue,
					sciencePopularization: sciencePopularization,
					detailedResults,
					conclusionArr: conclusionArr.sort((a, b) => a.length - b.length),
					suggestions,
					progressNum,
					imgAndScoreBlockType: mainResultD.imgAndScoreBlockType,
					otherTipText: mainResultD.otherTipText,
					otherTipImg: mainResultD.otherTipImg,
					mainImg,
					normComparison,
				}


				console.log(this.pageDataCommon, '====this.pageDataCommon')
			},

			processResultDataToRenderDataFpacpt(dData) {
				this.pageComp = 'fpacpt'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: JSON.parse(unescape(dData.resultList[0].resultDesc))
				}
			},
			processResultDataToRenderDataAnimalForest(dData) {
				this.pageComp = 'animalforest'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: JSON.parse(unescape(dData.resultList[0].resultDesc))
				}
			},
			processResultDataToRenderDataBestxg(dData) {
				this.pageComp = 'bestxg'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: JSON.parse(unescape(dData.resultList[0].resultDesc))
				}
			},
			processResultDataToRenderDataGoddess(dData) {
				this.pageComp = 'goddess'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: dData
				}
			},
			processResultDataToRenderDataMaiLun(dData) {
				this.shareData = {
					title: '定制我的脉轮水晶',
					path: '/pages/index/index?userType=mailun',
					imageUrl: this.$imgWxkjUrl + '/product/mailun_share_new_new.png'
				}
				this.pageComp = 'mailun'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: dData
				}
			},
			processResultDataToRenderDataQueen(dData) {
				this.pageComp = 'queen'
				this.navigationBarDataInfo.bg_color = "transparent"
				this.navigationBarDataInfo.hasEntity = false
				this.navigationBarDataInfo.name = ''
				this.pageDataCommon = {
					sclId: this.sclId,
					resultDetails: dData

				}
			},
			async processResultDataToRenderDataPageCommonSpecial(dData) {
				console.log(dData, '======dDatadDatadDatadDatadDatadDatadData')
				const result = dData.resultList[0]
				// console.log(dData.scloReportDetail,'=====dData.scloReportDetail')
				const mainResultD = JSON.parse(dData.scloReportDetail) || {}
				console.log(mainResultD, '=====mainResultD processResultDataToRenderDataPageCommonSpecial')
				if (mainResultD && mainResultD.pageType == 'SCL90') {
					//新版SCL90
					return this.processResultDataToRenderDataPageSCL90(dData)
				} else if (mainResultD && mainResultD.pageType == 'OLSON') {
					return this.processResultDataToRenderDataPageOLSON(dData)
				} else if (mainResultD && mainResultD.pageType == '3TO1') {
					return this.processResultDataToRenderData3TO1(dData)
				} else if (mainResultD && mainResultD.pageType == 'BD') {
					return this.processResultDataToRenderDataBD(dData)
				} else if (mainResultD && mainResultD.pageType == 'CRYL') {
					return this.processResultDataToRenderDataCRYL(dData)
				} else if (mainResultD && mainResultD.pageType == 'YIYU') {
					return this.processResultDataToRenderDataYIYU(dData)
				} else if (mainResultD && mainResultD.pageType == 'COPE') {
					return this.processResultDataToRenderDataCOPE(dData, mainResultD)
				} else if (mainResultD && mainResultD.pageType == 'YLQYB') {
					return this.processResultDataToRenderDataYLQYB(dData, mainResultD)
				} else if (mainResultD && mainResultD.pageType == 'YY3TO1') {
					return this.processResultDataToRenderDataYY3TO1(dData, mainResultD)
				} else if (mainResultD && mainResultD.pageType == 'QX') {
					return this.processResultDataToRenderDataQX(dData, mainResultD)
				} else if (mainResultD && mainResultD.pageType == 'fpacpt') {
					return this.processResultDataToRenderDataFpacpt(dData)
				} else if (mainResultD && mainResultD.pageType == 'animalforest') {
					return this.processResultDataToRenderDataAnimalForest(dData)
				} else if (mainResultD && mainResultD.pageType == 'bestxg') {
					return this.processResultDataToRenderDataBestxg(dData)
				} else if (mainResultD && mainResultD.pageType == 'goddess') {
					return this.processResultDataToRenderDataGoddess(dData)
				} else if (mainResultD && mainResultD.pageType == 'queen') {
					return this.processResultDataToRenderDataQueen(dData)
				} else if (mainResultD && mainResultD.pageType == 'mailun') {
					return this.processResultDataToRenderDataMaiLun(dData)
				} else if (JSON.stringify(mainResultD) != '{}') {
					console.log(mainResultD, '===mainResultD')
					//则走常规操作，遵循REDEME里的相关说明进行渲染
					console.log(dData, '====dData - OCEAN')

					return await this.processResultDataToRenderDataOCEAN(dData, mainResultD)
				}

				console.log(result, '===result')
				const resultDetails = JSON.parse(unescape(result.resultDesc))
				console.log(resultDetails, '========resultDetailsresultDetailsresultDetailsresultDetailsresultDetails')
				if (resultDetails.resultType == 'PPCS') {
					return this.processResultDataToRenderDataPagePPCS(dData)
				}

				this.pageComp = 'pageCommon'

				resultDetails.scoreArr[0].healthScore = unescape(resultDetails.scoreArr[0].healthScore)
				//最终结论
				const conclusionStr = resultDetails.conclusionStr

				//维度信息
				const tmpScoreArr = resultDetails.scoreArr.map(item => {
					return {
						label: item.label,
						score: parseInt(result.score),
						str: resultDetails.conclusionStr,
						commonInfo: unescape(item.healthScore)
					}
				})

				//常模信息
				const commonModel = resultDetails.normComparison

				// console.log(resultDetails,'====resultDetails')
				// console.log(unescape(resultDetails.scoreArr[0].healthScore),'=======resultDesc')

				resultDetails.sciencePopularization.contentArr.map(item => {
					item.p = unescape(item.p)
				})

				const tmpLiteratrue = resultDetails.literature || resultDetails.reference
				console.log(tmpLiteratrue, '=======tmpLiteratrue')

				dData.createDate = Number(dData.createDate)
				//最终完成的破事
				this.pageDataCommon = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					normComparison: commonModel,
					detailedResults: resultDetails.detailedResults,
					sciencePopularization: resultDetails.sciencePopularization,
					suggestions: resultDetails.suggestions,
					literatrue: tmpLiteratrue,
					referenceList: tmpLiteratrue,
					showProgressComp: resultDetails.showProgressComp,
				}

				console.log(this.pageDataCommon, '=====this.pageDataCommon')
			},
			percentValue(current, max) {
				if (max === 0) {
					// 防止除以零
					return 0
				}
				return (current / max) * 100
			},
			calculateConclusion(algorithmJson, scoreData) {
				console.log(algorithmJson, '-----algorithmJson')
				console.log(scoreData, '-----scoreData')
				/**
				 输入示例
				 const algorithmJson = {
				  "algorithmJson": {
				    "conclusionResultArr": [
				    {
				        "result": {
				          "conclusion": "轻度倦怠",
				          "detailedResults": {}
				        },
				        "Algorithm": "情绪衰竭=[25,99999]&去人性化=[0,11]&低成就感=[0,16]|情绪衰竭=[0,25]&去人性化=[11,99999]"
				      },
				    ]
				  }
				  const scoreData = [
				    { dmnsName: "情绪衰竭", qujian: "1000", myScore: "1" },
				    { dmnsName: "去人性化", qujian: "1000", myScore: "1" },
				    { dmnsName: "低成就感", qujian: "1000", myScore: "0" }
				  ]
				 */

				for (let i = 0; i < algorithmJson.conclusionResultArr.length; i++) {
					const rule = algorithmJson.conclusionResultArr[i]
					const qujianArr = rule.Algorithm.split("|")
					let isMatched = false
					for (let j = 0; j < qujianArr.length; j++) {
						//这里只要有一个满足就匹配
						const qujianStrArr = qujianArr[j].split("&")
						let isMatched1 = true
						for (let k = 0; k < qujianStrArr.length; k++) {
							//这里只要有一个不满足就不匹配
							const qujianStr = qujianStrArr[k]
							const qujianArrTmp = qujianStr.substring(qujianStr.indexOf("[") + 1, qujianStr.indexOf("]"))
								.split(",")
							const min = parseInt(qujianArrTmp[0])
							const max = parseInt(qujianArrTmp[1])
							const property = qujianStr.substring(0, qujianStr.indexOf("="))
							const data = scoreData.find(item => item.dmnsName === property)
							if (!(data && data.myScore >= min && data.myScore <= max)) {
								isMatched1 = false
								break
							}
						}
						if (isMatched1) {
							isMatched = true
							break
						}
					}

					if (isMatched) {
						console.log(rule.result, '=============rule.result')
						return rule.result
					}
				}

				return null
			},
			processResultDataToDongWuLian(dData) {
				this.pageDataCommon = dData
			},
			processResultDataToRenderDataPageMBTI(dData) {
				const result = dData.resultList[0]
				const conclusionArr = result.resultTitle.split("——")

				let mainResult
				let recommendJobImg
				try {
					// mainResult = unescape(result.modelDescList[0].modelDesc)
					mainResult = unescape(result.resultDesc)
					mainResult = JSON.parse(mainResult)
					// console.log(result.modelDescList[4].modelDesc,'-----result.modelDescList[4].modelDesc')
					if (result?.modelDescList[4]) {
						recommendJobImg = result.modelDescList[4].modelDesc.match(/"([^"]*)"/)[0]
						recommendJobImg = recommendJobImg.replace(/"/g, '')
					}

					console.log(recommendJobImg, '====recommendJobImg')
				} catch (e) {
					this.$showToast("结果异常,请联系客服")
					return setTimeout(() => {
						uni.reLaunch({
							url: '/pages/sclList/sclList'
						})
					}, 2000)
				}

				console.log(mainResult, 'console======mainResult')

				//常模信息
				const commonModel = JSON.parse(dData.normUrl)
				console.log(dData, '====== processResultDataToRenderDataPageMBTI')


				const scoreArr = []
				const scoreLabelArr = ['精力支配', '认识世界', '判断事物', '生活态度']
				const mbtidDict = {
					I: '内倾',
					E: '外倾',
					S: '实感',
					N: '直觉',
					T: '理智',
					F: '情感',
					J: '判断',
					P: '理解'
				}
				const maxScores = {
					"JP": 22,
					"SN": 26,
					"IE": 21,
					"TF": 24
				}

				// 取前8个元素
				const firstEightElements = dData.dmnsList.slice(0, 8);
				const groupedArray = [];
				for (let i = 0; i < firstEightElements.length; i += 2) {
					groupedArray.push(firstEightElements.slice(i, i + 2));
				}

				for (let i = 0; i < groupedArray.length; i++) {
					const item = groupedArray[i][0]
					const element = groupedArray[i][1]

					let maxNum = 0
					// 查找包含变量 I 值的键并输出对应的值
					for (const key in maxScores) {
						if (key.includes(element.dmnsName)) {
							maxNum = maxScores[key]
						}
					}



					const obj1 = {
						label: mbtidDict[element.dmnsName] + `(${element.dmnsName})`,
						num: 100 - this.percentValue(element.dmnsScore, maxNum),
						originNum: this.percentValue(element.dmnsScore, maxNum),
					}
					const obj2 = {
						label: mbtidDict[item.dmnsName] + `(${item.dmnsName})`,
						num: this.percentValue(item.dmnsScore, maxNum),
						originNum: this.percentValue(item.dmnsScore, maxNum),
					}


					scoreArr.push({
						label: scoreLabelArr[i],
						actIndex: obj1.originNum > obj2.originNum ? 0 : 1,
						arr: [
							obj1,
							obj2
						]
					})
				}

				let normalComData

				if (commonModel[1]) {
					normalComData = {
						tit: commonModel[0],
						img: commonModel[1]
					}
				} else {
					normalComData = {
						tit: '人群中不同性格类型水平分布图',
						img: mainResult.fbImg
					}
				}

				dData.createDate = Number(dData.createDate)
				this.pageDataMBTI = {
					id: this.reportId,
					name: dData.sclName,
					serialNumber: dData.serialNumber,
					conclusion1: conclusionArr[1],
					conclusion2: conclusionArr[0],
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					normComparison: {
						tit: commonModel[0],
						img: commonModel[1]
					},
					scoreArr: scoreArr,
					mainResult: mainResult,
					recommendJobImg: recommendJobImg,
					referenceList: mainResult.referenceList
				}
			},
			processResultDataToRenderDataPageSCL90(dData) {
				this.pageComp = 'pageSCL90'
				const result = dData.resultList[0]
				console.log(result, '====result')
				const resultDetails = JSON.parse(unescape(result.resultDesc))
				console.log(resultDetails, '=====resultDetails')

				//参考文献
				let literatrueArr = []
				if (resultDetails && resultDetails.reference) {
					literatrueArr = resultDetails.reference
				}

				//结果详情下的数组
				let resultDetailListTmpArr = []
				const mainDataContentArr = []
				if (dData.resultList.length > 1) {
					resultDetailListTmpArr = dData.resultList.slice(1, dData.resultList.length).map(item => {
						console.log(item, '====item-resultDetailListTmpArr')
						console.log(item.resultTitle, '===item.resultTitle')
						const sectionData = JSON.parse(unescape(item.resultDesc))
						console.log(item.dmnsName, '===item.dmnsName')
						console.log(sectionData, '====sectionData')
						// console.log(item.intro,'====item.suggestions')
						// debugger
						return {
							tit: item.dmnsName,
							conclusion: sectionData.conclusion,
							// intro:sectionData.intro,
							p: sectionData.intro, //item.resultDesc.replace("&nbsp;",''),
							suggestions: sectionData
								.suggestions //item.resultTitle ? JSON.parse(item.resultTitle).suggestions : ''
						}
					})
				}



				console.log(resultDetailListTmpArr, '===resultDetailListTmpArr')
				//维度信息
				const categoriesArr = []
				const commonModelData = []
				const myModelData = []
				let tmpScoreArr = []
				const commonModelInfo = resultDetails.scoreArr
				tmpScoreArr = dData.resultSetMap.map((item, index) => {
					const currentHeathNum = commonModelInfo.find(node => item.dmnsName === node.label).healthIndex
					const currentConclusion = resultDetailListTmpArr.find(node => item.dmnsName === node.tit)
					categoriesArr.push(item.dmnsName)
					commonModelData.push(Number(currentHeathNum))
					myModelData.push(Number(item.myScore))

					return {
						label: item.dmnsName,
						score: parseInt(item.myScore),
						str: currentConclusion.conclusion, //item.myIndex,
						commonInfo: currentHeathNum
					}
				})
				tmpScoreArr.unshift({
					label: "总分",
					score: result.score,
					str: resultDetails.shortConclusion, //item.myIndex,
					commonInfo: resultDetails.healthNum
				})

				const tmpRadarData = {
					"categories": categoriesArr,
					"series": [{
							"name": "常模",
							"color": "#FEB069",
							"data": commonModelData,
							"index": 0,
							"pointShape": "square",
							// "labelText":'190,210,105,35,27,102,190,210,105',
							"show": true,
							"labelShow": false,
							"textColor": "rgba(0,0,0,0)",
							"type": "radar"
						},
						{
							"name": "雷达图",
							"color": "#6B77FF",
							"data": myModelData,
							"index": 0,
							"pointShape": "square",
							"show": true,
							"type": "radar",
							"labelShow": true,
							// show:true
						},
					]
				}

				console.log(dData, '=======dData')

				dData.createDate = Number(dData.createDate)

				let existDetails = dData.existDetails
				try {
					existDetails = JSON.parse(dData.existDetails)
				} catch (e) {
					if (dData.existDetails) {
						existDetails = [dData.existDetails]
					}
				}

				console.log(existDetails, '----existDetails')
				if (dData.detailInfo && dData.detailInfo.isSclAllReport) {
					this.isSclAllReport = dData.detailInfo && dData.detailInfo.isSclAllReport;
				}
				this.pageDataB = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					detailInfo: dData.detailInfo, //测评表配置信息
					conclusion: resultDetails.conclusion, //result.resultTitle,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					literatrue: literatrueArr,
					scoreArr: tmpScoreArr,
					normComparison: {
						tit: '心理状态人群分布', //resultDetails.normComparison.tit,//commonModel[0],
						img: resultDetails.normComparison.url //this.imgBaseURL + '/scl/scl_result_custom_bg.png'
					},
					radarData: tmpRadarData,
					// mainResult.knowledge[1]
					sciencePopularization: resultDetails.sciencePopularization, //knowledge,
					detailedResults: {
						tit: '',
						p: resultDetails.detailedResults.p, //result.resultDesc.replace(/&nbsp;/g,""),
						contentArr: resultDetailListTmpArr, //mainDataContentArr,//resultDetails.detailedResults.contentArr
					},
					existDetails
				}
			},
			processResultDataToRenderDataPageA(dData) {
				console.log(dData, '=======dData')
				const result = dData.resultList[0]
				const resultDetailTmpArr = result.resultDesc.split('====')
				//结果详情下的数组
				let resultDetailListTmpArr = []
				if (resultDetailTmpArr.length > 1) {
					const tmpArr = resultDetailTmpArr[1].split('----')
					resultDetailListTmpArr = tmpArr.map(item => {
						const tmp = item.split('++++')
						return {
							tit: tmp[0],
							p: tmp[1]
						}
					})
				}

				const mainResult = JSON.parse(dData.scloReportDetail)
				//最终结论
				const conclusionStr = result.resultTitle.split("（")[0]

				//维度信息
				const tmpScoreArr = dData.resultSetMap.map(item => {
					return {
						label: item.dmnsName,
						score: parseInt(item.myScore),
						str: item.myIndex,
						commonInfo: item.healthIndex
					}
				})

				//常模信息
				const commonModel = JSON.parse(dData.normUrl)

				//该接口返回值经过多人编辑，未形成规范、前端自行根据各个特殊测评来查找字段进行转换
				const sciencePopularizationArr = mainResult.knowledge.slice(2, mainResult.knowledge.length).map(item => {
					const obj = {
						tit: item[0]
					}
					if (typeof(item[1]) == 'string') {
						obj['p'] = item[1]
					} else {
						obj['list'] = item[1]
					}
					return obj
				})

				//建议
				const suggestArr = mainResult.suggest.slice(1, mainResult.suggest.length).map(item => {
					const obj = {
						tit: item[0],
						p: item[1]
					}
					return obj
				})

				dData.createDate = Number(dData.createDate)


				//最终完成的破事
				this.pageDataA = {
					id: this.reportId,
					serialNumber: dData.serialNumber,
					name: dData.sclName,
					sclTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					conclusion: conclusionStr,
					createTime: this.$dayjs(dData.createDate).format("YYYY-MM-DD HH:mm"),
					scoreArr: tmpScoreArr,
					normComparison: {
						tit: commonModel[0],
						img: commonModel[1] //this.imgBaseURL + '/scl/scl_result_custom_bg.png'
					},
					detailedResults: {
						tit: result.resultTitle,
						p: resultDetailTmpArr[0],
						contentArr: resultDetailListTmpArr
					},
					sciencePopularization: {
						tit: mainResult.knowledge[1], //'如何区分抑郁情绪、抑郁状态和抑郁',
						p: '',
						contentArr: sciencePopularizationArr,
					},
					suggestions: {
						tit: '',
						p: mainResult.suggest[0][1],
						contentArr: suggestArr,
					},
					literatrue: mainResult.literatrue,
				}
			},
			processResultDataToRenderData(dData) {
				const result = dData.resultList[0]
				const returnArr = []
				if (result && result.modelDescList && result.modelDescList.length > 0) {
					result.modelDescList.forEach((item, i) => {
						if (i == 0) {
							dData.resultList.forEach((dim, j) => {
								var obj = {};
								//结果内容
								var modelCont = dim.modelDescList[i].modelDesc
								//概况图片
								if (dim.resultPic) {
									obj.resultPic = dim.resultPic
									obj.isResultPic = true
								} else {
									obj.isResultPic = false
								}

								var intervalArr = "";
								var intervalIndex = "";
								var intervalMax = "";
								var interval = "";
								//维度得分
								if (dim.score && dim.score != "" && dim.score != null && dData
									.resultShow == "2") {
									obj.score = dim.score;
								}
								//维度名称
								if (dim.dmnsName) {
									obj.dmnsName = dim.dmnsName;
								}
								//维度区间去最大值
								if (
									dData.resultSetMap.length != 0 &&
									dData.resultSetMap != null &&
									dData.resultSetMap != "" &&
									dData.resultShow == "2"
								) {
									for (var n = 0; n < dData.resultSetMap.length; n++) {
										if (dData.resultSetMap[n].dmnsName == dim.dmnsName) {
											intervalArr = dData.resultSetMap[n].qujian.split(",")
											intervalIndex = intervalArr.length - 1
											intervalMax = parseInt(intervalArr[intervalIndex]) - 1
											obj.interval = intervalMax;
											break;
										}
									}
								}
								//结果标题
								if (dim.resultTitle != "" && dim.resultTitle != null) {
									obj.resultTitle = dim.resultTitle;
								}
								obj.resultDesc = this.initRichText(modelCont);

								returnArr.push(obj);
							})
						} else {
							dData.resultList.forEach((dim, j) => {

								var obj = {}
								var modelCont = dim.modelDescList[i].modelDesc
								if (j == 0) {
									//模块标题+内容
									if (dim.resultTitle != "" && dim.resultTitle != null) {
										obj.resultTitle = '【' + dim.modelDescList[i].modelTitle + '】'
										obj.weiduTitle = 'weiduTitle';
									}
									obj.resultDesc = this.initRichText(modelCont)
								} else {
									//维度标题+内容
									obj.resultTitle = j + "." + dim.dmnsName
									obj.weiduTitleName = 'weiduTitleName'
									obj.resultDesc = this.initRichText(modelCont)
								}
								if (dim.dmnsName) {
									returnArr.push(obj)
								}
							})
						}
					})
				}
				return returnArr
			},
			async createX02Img(tmpFloatInfo) {
				const {
					data: dRes
				} = await this.$u.api.getQrcodeUrl({
					sceneStr: `p=2@d=999@id=${this.sclId}`,
					pageStr: 'pages/index/index'
				})

				let canvasImg = ''

				if (dRes.success) {
					this.qrCode = dRes.data
				}

				this.fanhuaData = {
					flotImg: tmpFloatInfo.val.floatImg,
					resultImg: canvasImg || tmpFloatInfo.val.resultImg,
				}
			},
			initCanvas(data) {
				if (!data || data.resultGraph == '' || data.resultGraph == null) {
					this.isCanvasBox = false;
				} else {
					this.isCanvasBox = true;
					if (data.resultGraph == "ldt") {
						// 雷达 ldt
						var chartDataRader = {};
						chartDataRader.categories = [];
						var myScore = [];
						for (var i = 0; i < data.resultSetMap.length; i++) {
							chartDataRader.categories.push(data.resultSetMap[i].dmnsName);
						};
						chartDataRader.series = [];
						chartDataRader.series[0] = {};
						chartDataRader.series[0].name = '分数显示';
						chartDataRader.series[0].data = [];
						for (var i = 0; i < data.resultSetMap.length; i++) {
							chartDataRader.series[0].data.push(data.resultSetMap[i]
								.myScore);
						};
						this.showRadar('canvasPie', chartDataRader, 1);
					} else if (data.resultGraph == "zzt") {
						//柱状
						let score = parseInt(data.resultSetMap[0].myScore);
						let showYiBiaoData = {
							categories: [{
								"value": 0.2,
								"color": "#30b26a"
							}, {
								"value": 0.8,
								"color": "#eab438"
							}, {
								"value": 1,
								"color": "#ff4500"
							}],
							series: [{
								name: "完成率",
								data: (score / 100).toFixed(2)
							}]
						};
						this.showYiBiao('canvasPie', showYiBiaoData, score)
					} else if (data.resultGraph == "zxt") {
						//zxt 折线
						var qujianArr = data.resultSetMap[0].qujian.split(",");
						var chartDataColumn = {};
						chartDataColumn.categories = [' ', ' ', ' ', ' ', ' '];
						chartDataColumn.series = [];
						chartDataColumn.series[0] = {};
						chartDataColumn.series[0].name = '分数显示';
						chartDataColumn.series[0].data = qujianArr;
						this.showLine('canvasPie', chartDataColumn);
					} else if (data.resultGraph == "bzt") {
						var qujianArr = data.resultSetMap[0].qujian.split(",");
						var chartDataColumn = {};
						chartDataColumn.series = [];
						chartDataColumn.series[0] = {};
						chartDataColumn.series[0].name = '分数显示';
						chartDataColumn.series[0].data = qujianArr;
						this.showPie('canvasPie', chartDataColumn);
					}
				};
			},
			showYiBiao(canvasId, data, score) {
				const canvasPie = new uCharts({
					$this: _self,
					type: "gauge",
					canvasId: canvasId,
					pixelRatio: _self.pixelRatio,
					width: _self.cWidth * _self.pixelRatio,
					height: _self.cHeight * _self.pixelRatio,
					categories: data.categories,
					series: data.series,
					animation: true,
					background: "#FFFFFF",
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: undefined,
					title: {
						name: score,
						fontSize: 25,
						color: "#2fc25b",
						offsetY: 50
					},
					subtitle: {
						name: "",
						fontSize: 15,
						color: "#666666",
						offsetY: -50
					},
					extra: {
						gauge: {
							type: "default",
							width: 16,
							labelColor: "#666666",
							startAngle: 0.75,
							endAngle: 0.25,
							startNumber: 0,
							endNumber: 100,
							labelFormat: "",
							splitLine: {
								fixRadius: 0,
								splitNumber: 10,
								width: 30,
								color: "#FFFFFF",
								childNumber: 5,
								childWidth: 12
							},
							pointer: {
								width: 24,
								color: "auto"
							}
						}
					}
				});
			},
			showLine(canvasId, chartData) {
				canvaPie = new uCharts({
					$this: _self,
					canvasId: canvasId,
					type: 'line',
					fontSize: 11,
					legend: {
						show: true
					},
					dataLabel: false,
					dataPointShape: true,
					background: '#FFFFFF',
					pixelRatio: _self.pixelRatio,
					categories: chartData.categories,
					series: chartData.series,
					animation: true,
					xAxis: {
						type: 'grid',
						gridColor: '#CCCCCC',
						gridType: 'dash',
						dashLength: 8
					},
					yAxis: {
						gridType: 'dash',
						gridColor: '#CCCCCC',
						dashLength: 8,
						splitNumber: 5,
						min: 10,
						max: 100,
						format: (val) => {
							return val.toFixed(0) + ''
						}
					},
					width: _self.cWidth * _self.pixelRatio,
					height: _self.cHeight * _self.pixelRatio,
					extra: {
						line: {
							type: 'straight'
						}
					}
				});
			},
			showRadar(canvasId, chartData, max) {
				const canvaRadar = new uCharts({
					$this: _self,
					canvasId: canvasId,
					type: 'radar',
					fontSize: 11,
					legend: {
						show: true,
						fontSize: 6
					},
					background: '#FFFFFF',
					pixelRatio: _self.pixelRatio,
					animation: true,
					dataLabel: true,
					categories: chartData.categories,
					series: chartData.series,
					width: _self.cWidth * _self.pixelRatio,
					height: _self.cHeight * _self.pixelRatio,
					extra: {
						radar: {
							max: max //雷达数值的最大值
						}
					}
				});
			},
			showColumn(canvasId, chartData) {
				const canvaColumn = new uCharts({
					$this: _self,
					canvasId: canvasId,
					type: 'column',
					legend: {
						show: true
					},
					fontSize: 11,
					background: '#FFFFFF',
					pixelRatio: _self.pixelRatio,
					animation: true,
					categories: chartData.categories,
					series: chartData.series,
					xAxis: {
						disableGrid: false,
					},
					yAxis: {
						disabled: false,
					},
					dataLabel: true,
					width: _self.cWidth * _self.pixelRatio,
					height: _self.cHeight * _self.pixelRatio,
					extra: {
						column: {
							type: 'group',
							width: _self.cWidth * _self.pixelRatio * 0.3 / chartData.categories.length
						}
					}
				});

			},
			showPie(canvasId, chartData) {
				const canvaPie = new uCharts({
					$this: _self,
					canvasId: canvasId,
					type: 'pie',
					fontSize: 11,
					legend: true,
					background: '#FFFFFF',
					pixelRatio: _self.pixelRatio,
					series: chartData.series,
					animation: true,
					width: _self.cWidth * _self.pixelRatio,
					height: _self.cHeight * _self.pixelRatio,
					dataLabel: true,
					extra: {
						pie: {
							lableWidth: 15
						}
					},
				});
			},
			toExplanation() {
				console.log(this.explanationState, 'this.explanationState----------------')
				// 预约订单
				if (this.explanationState === 1) {
					this.explanationOrderModalShow = true
				} else if (this.explanationState === 2) {
					uni.navigateTo({
						url: '/subcontractorA/explanationOrder/explanationOrder'
					})
				}
			},
			getExplanationModalShow() {
				this.isExistExplanationOrderModal = false
				if (this.sclReportType === '1') {
					// 个人体检预约订单弹框
					if (this.showExplanation) {
						showExplanation().then(res => {
							if (res.data.success && [1, 2].includes(res.data.data)) {
								this.isExistExplanationOrderModal = true
								if (res.data.data === 1) {
									this.explanationOrderModalShow = true
								}
								this.explanationState = res.data.data
							}
						})
					}
				}
			},
			async orderPay() {
				if (this.$fangBaoClick()) return
				let that = this;
				const {
					data: res
				} = await this.$u.api.getCheckUpList()
				let submitForm = {
					orderType: '12',
					sclId: res.data.sclId
				}
				this.$u.api.orderPay(submitForm).then(res => {
					if (res.data.code == 200) {
						uni.requestPayment({
							provider: 'wxpay',
							service: 5,
							orderInfo: res.data.data.wr,
							timeStamp: res.data.data.wr.timeStamp,
							nonceStr: res.data.data.wr.nonceStr,
							package: res.data.data.wr.packageValue,
							signType: res.data.data.wr.signType,
							paySign: res.data.data.wr.paySign,
							success(res) {
								uni.removeStorageSync('hasDoneCheckupScl')
								uni.removeStorageSync('checkupSclId')
								uni.removeStorageSync('from')
								that.$store.commit('user/setIsPaySclExamination', true)
								uni.redirectTo({
									url: '/subcontractorB/pages/sclResult/sclResult?id=' +
										that.reportId +
										'&sclReportType=1'
								})
							},
							fail(err) {
								// that.$showToast('支付取消');
								uni.navigateTo({
									url: `/subcontractorD/pages/sclCheckUpNewPayPage/sclCheckUpNewPayPage?from=result&sourceType=30&sclId=${that.sclId}&reportId=${that.reportId}`
								})
							}
						})
					} else {
						that.$showToast(res.data.message);
					}

				}).catch(() => {})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import url(sclResult.css);

	/deep/.title-text2 * {
		font-size: 28rpx !important;
		line-height: 50rpx !important;
		font-family: STHeitiSC-Light;
		font-weight: normal;
		font-stretch: normal;
		margin-bottom: 0rpx !important;
	}

	/deep/.title-text2 p {
		font-size: 28rpx !important;
		line-height: 50rpx !important;
		font-family: STHeitiSC-Light;
		font-weight: normal;
		font-stretch: normal;
		margin-bottom: 0rpx !important;
	}

	/deep/.text-con .u-count-down__text {
		margin: 0 2rpx;
		font-size: 34rpx !important;
		line-height: 40rpx !important;
		color: #FA3E99 !important;
	}

	/deep/.right-price-box-dec-wrapper .u-count-down__text {
		color: #fff !important;
		font-size: 24rpx !important;
		line-height: 50rpx !important;
	}



	.scl-3-to-1-tit {
		text-align: center;
		margin-bottom: 35rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333;

		transform: translateX(-50%);
	}

	.mt-52 {
		margin-top: 52rpx;
	}

	.flot-info-wrapper {
		position: fixed;
		bottom: 20vh;
		right: 20rpx;
		z-index: 11;



		.img {
			width: 100%;
			height: 100%;
		}
	}

	.float-info-wrapper-2 {
		width: 148rpx;
		height: 128rpx;
	}

	.scl-result-page {
		.title_box {
			margin-top: 30rpx;
		}

		padding-bottom: 100rpx;
		box-sizing: border-box;

		.bottom-box {

			.bb-share {
				position: relative;

				.share-tip-img {
					position: absolute;
					top: 0;
					right: 0;
					width: 218rpx;
					height: 162rpx;

					top: -152rpx;
					left: -28rpx;
				}

				.bb-share-text {
					.text {
						font-size: 24rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 500;
						color: #333435;
					}
				}
			}
		}
	}



	@keyframes shakebox {
		0% {
			transform: translateZ(0);
		}

		15% {
			transform: translate3d(0, -5px, 0);
		}

		25% {
			transform: translate3d(0, 0, 0);
		}

		45% {
			transform: translate3d(0, -5px, 0);
		}

		55% {
			transform: translate3d(0, 0, 0);
		}

		65% {
			transform: translate3d(0, -5px, 0);
		}

		75% {
			transform: translate3d(0, 0, 0);
		}

		85% {
			transform: translate3d(0, -5px, 0);
		}

		100% {
			transform: translate3d(0, 0, 0);
		}
	}

	.topToBottomShake {
		animation: shakebox 8s linear infinite;
		-webkit-animation: shakebox 8s linear infinite;
	}



	.btns-wrapper {
		display: flex;
		margin-right: 30rpx;
		height: 130rpx;
		align-items: center;
		flex: 1 0 auto;
		justify-content: flex-end;
	}

	.bottom-box {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.bb-more-scl,
	.btn-to-more-scl {
		position: relative;

		.bb-more-scl-img {
			width: 100%;
			height: 100%;
		}

		.bb-more-scl-text {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			height: 70rpx;
			line-height: 70rpx;
			pointer-events: none;
		}
	}

	.coupon-tip-position {
		position: fixed;
		right: 292rpx;
		bottom: 98rpx;
		width: 282rpx;
		height: 112rpx;
		z-index: 1000;

		.coupon-tip-box {
			position: relative;
			width: 282rpx;
			height: 112rpx;

			.coupon-tip-img,
			.coupon-tip-text {
				position: absolute;
				// right: -38rpx;
				right: -19rpx;
				top: 0;
				height: 98rpx;
				width: 246rpx;
				width: 282rpx;
				height: 112rpx;

			}

			.coupon-tip-text {
				font-size: 24rpx;

				color: #fff;

				text-align: center;
				line-height: 96rpx;
				padding-left: 62rpx;
				box-sizing: border-box;
			}


		}




		.yiyuan-coupon-tip-box {
			width: 365rpx;
			height: 170rpx;

			.coupon-tip-img {
				width: 365rpx;
				height: 170rpx;
			}
		}
	}

	.yiyuan-coupon-tip-position {
		right: 252rpx;
		width: 365rpx;
		height: 170rpx;
	}

	.checkup-mental-entry-box {

		width: 100%;
		margin-top: 30rpx;
		margin-bottom: 8rpx;
		justify-content: center;
		display: flex;
		align-items: center;
	}

	.checkup-mental-entry-box {
		margin-top: 0;
	}

	/deep/ .result-custom-page {
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	/deep/ .report-time-box {
		padding-bottom: 0 !important;
	}

	.bb-lx {
		position: relative;

		.bb-lx-img {
			width: 100%;
			height: 100%;
		}

		.bb-lx-text {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			height: 70rpx;
			line-height: 70rpx;
			pointer-events: none;
		}
	}

	.explanation-img {
		position: fixed;
		width: 134rpx;
		height: 143rpx;
		right: 0;
		bottom: 560rpx;
	}
</style>